Documentation
¶
Index ¶
- Constants
- func EvalTagExpr(expr *TagExpr, tags map[string]struct{}, methods map[string]struct{}) bool
- func FindNonterminalRoutesWithoutChildren(routes []CompiledRoute) (withoutChildren []int)
- func GetRouteRegexps(routes []CompiledRoute, filter *TagExpr) routeRegexps
- func GroupRoutes(rwps []RouteWithParents) [][]RouteWithParents
- func ParseJsonRouteFile(input io.Reader, casePolicy CasePolicy) (entries []RouteFileEntry, errors []RouteError)
- func ParseRouteFile(input io.Reader, casePolicy CasePolicy) ([]RouteFileEntry, []RouteError)
- func ProcessRouteFiles(files [][]RouteFileEntry, filenames []string, nameSeparator string) ([]CompiledRoute, []RouteError)
- func RouteRegexpsToJSON(rrs *routeRegexps, filter *TagExpr) ([]byte, int)
- type CasePolicy
- type CompiledRoute
- type InclusionStatus
- type RouteError
- type RouteErrorKind
- type RouteFileEntry
- type RouteInfo
- type RouteRegexp
- type RouteWithParents
- type TagExpr
Constants ¶
View Source
const BiggestOverlapGroupAllowedBeforeWarning = 5
View Source
const MaxOverlapGroupErrors = 10
Variables ¶
This section is empty.
Functions ¶
func EvalTagExpr ¶ added in v0.5.1
func FindNonterminalRoutesWithoutChildren ¶ added in v0.7.7
func FindNonterminalRoutesWithoutChildren(routes []CompiledRoute) (withoutChildren []int)
func GetRouteRegexps ¶
func GetRouteRegexps(routes []CompiledRoute, filter *TagExpr) routeRegexps
func GroupRoutes ¶ added in v0.7.0
func GroupRoutes(rwps []RouteWithParents) [][]RouteWithParents
func ParseJsonRouteFile ¶ added in v0.7.0
func ParseJsonRouteFile(input io.Reader, casePolicy CasePolicy) (entries []RouteFileEntry, errors []RouteError)
func ParseRouteFile ¶
func ParseRouteFile(input io.Reader, casePolicy CasePolicy) ([]RouteFileEntry, []RouteError)
func ProcessRouteFiles ¶ added in v0.7.0
func ProcessRouteFiles(files [][]RouteFileEntry, filenames []string, nameSeparator string) ([]CompiledRoute, []RouteError)
func RouteRegexpsToJSON ¶
Types ¶
type CasePolicy ¶ added in v0.4.0
type CasePolicy int
const ( AllowUpperCase CasePolicy = iota DisallowUpperCase CasePolicy = iota )
type CompiledRoute ¶ added in v0.7.0
type CompiledRoute struct { Info RouteInfo Compiled RouteRegexp }
type InclusionStatus ¶ added in v0.5.1
type InclusionStatus int
const ( Include InclusionStatus = iota Exclude InclusionStatus = iota Union InclusionStatus = iota )
type RouteError ¶
type RouteError struct { Kind RouteErrorKind Line int Col int DuplicateName string OtherLine int IOError error Filenames []string Group []RouteWithParents JsonError j.Token }
func CheckForGroupErrors ¶ added in v0.7.0
func CheckForGroupErrors(routes []CompiledRoute) (errors []RouteError)
func ParseRouteFiles ¶
func ParseRouteFiles(inputFiles []string, inputReaders []io.Reader, jsonStart int, casePolicy CasePolicy) ([][]RouteFileEntry, []RouteError)
func (RouteError) Error ¶
func (e RouteError) Error() string
type RouteErrorKind ¶
type RouteErrorKind int
const ( MissingNameOrRoute RouteErrorKind = iota DuplicateRouteName RootMustStartWithSlash OverlappingRoutes MisplacedDot RouteContainsBadCodePoint QuestionMarkInRoute HashInRoute WhitespaceInRoute IllegalCharInParamName IllegalBackslashEscape IllegalBackslashEscapeInRouteName NontabspaceIndentationCharacter BadCharacterInMethodName MissingCommaBetweenMethodNames TwoCommasInSequenceInMethodNames IndentLessThanFirstLine OnlyNoTrailingSlash NoTrailingSlashAfterSlash NoParamAfterParam NoTrailingSlashInMiddle MultipleSlashesInARow UpperCaseCharInRoute IOError EmptyMethodList ExpectedJSONRoutesToBeArray ExpectedJSONRouteFileEntryToBeObject UnexpectedKeyInJSONRouteFile JSONRouteMissingNameField JSONRouteMissingPatternField InvalidJsonInJSONRouteFile UnexpectedTokenInJSONRouteFile NoSlashInsideJSONRoutePatternElement FirstMemberOfJSONRouteFilePatternElementMustBeString BadFirstMemberOfJSONRouteFilePatternElement UnexpectedJSONRouteFilePatternElementMember JSONRouteFilePatternElementParameterNameMustBeString WarningBigGroup = iota | RouteWarning )
const RouteWarning RouteErrorKind = (1 << 30)
type RouteFileEntry ¶
type RouteFileEntry struct {
// contains filtered or unexported fields
}
type RouteRegexp ¶ added in v0.7.0
type RouteWithParents ¶
type RouteWithParents struct { Route *CompiledRoute Parents []*CompiledRoute }
Click to show internal directories.
Click to hide internal directories.