gosora/router_gen/route_impl.go
Azareal f8e892da20 Added the Rez Image Resizer as a dependency to be used later.
Is Codebeat fixed now?
Fixed a data race in PreRoute and refactored away the duplicate IP Address loads.
Renamed some of the variables in the query generator.
Slight bit more progress on Cosora.
2017-11-10 00:16:15 +00:00

39 lines
781 B
Go

package main
type RouteImpl struct {
Name string
Path string
Vars []string
RunBefore []Runnable
}
type Runnable struct {
Contents string
Literal bool
}
func addRoute(route *RouteImpl) {
routeList = append(routeList, route)
}
func (route *RouteImpl) Before(item string, literal ...bool) *RouteImpl {
var litItem bool
if len(literal) > 0 {
litItem = literal[0]
}
route.RunBefore = append(route.RunBefore, Runnable{item, litItem})
return route
}
func addRouteGroup(routeGroup *RouteGroup) {
routeGroups = append(routeGroups, routeGroup)
}
func blankRoute() *RouteImpl {
return &RouteImpl{"", "", []string{}, []Runnable{}}
}
func Route(fname string, path string, args ...string) *RouteImpl {
return &RouteImpl{fname, path, args, []Runnable{}}
}