{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:golang/github.com/vardius/gorouter","name":"github.com/vardius/gorouter","description":"Package gorouter provide request router with middleware\n\nThe router determines how to handle that request.\nGoRouter uses a routing tree. Once one branch of the tree matches, only routes inside that branch are considered,\nnot any routes after that branch. When instantiating router, the root node of tree is created.\n\n- Static `/hello` (will match requests matching given route)\n\n- Named `/{name}` (will match requests matching given route scheme)\n\n- Regexp `/{name:[a-z]+}` (will match requests matching given route scheme and its regexp)\n\nThe values of *named parameter* or *regexp parameters* are accessible via *request context*\n`params, ok := gorouter.FromContext(req.Context())`.\nYou can get the value of a parameter either by its index in the slice, or by using the `params.Value(name)` method:\n`:name` or `/{name:[a-z]+}` can be retrieved by `params.Value(\"name\")`.\n\nA full route definition contain up to three parts:\n\n1. HTTP method under which route will be available\n\n2. The URL path route. This is matched against the URL passed to the router,\nand can contain named wildcard placeholders *(e.g. {placeholder})* to match dynamic parts in the URL.\n\n3. `http.HandleFunc`, which tells the router to handle matched requests to the router with handler.\n\nTake the following example:\n\nIn this case, the route is matched by `/hello/rxxxxxgo` for example,\nbecause the `:name` wildcard matches the regular expression wildcard given (`r([a-z]+)go`). However,\n`/hello/foo` does not match, because \"foo\" fails the *name* wildcard. When using wildcards,\nthese are returned in the map from request context. The part of the path that the wildcard matched (e.g. *rxxxxxgo*) is used as value.","version":"v3.0.4+incompatible","softwareVersion":"v3.0.4+incompatible","license":"https://spdx.org/licenses/MIT","codeRepository":"https://github.com/vardius/gorouter","issueTracker":"https://github.com/vardius/gorouter/issues","url":"https://github.com/vardius/gorouter","programmingLanguage":{"@type":"ComputerLanguage","name":"Go"},"dateCreated":"2017-04-10","dateModified":"2018-02-26","datePublished":"2018-02-26","copyrightYear":2017,"downloadUrl":"https://proxy.golang.org/github.com/vardius/gorouter/@v/v3.0.4+incompatible.zip","softwareHelp":{"@type":"WebSite","url":"https://pkg.go.dev/github.com/vardius/gorouter#section-documentation"},"applicationCategory":"go","runtimePlatform":"go","developmentStatus":"active","sameAs":["https://pkg.go.dev/github.com/vardius/gorouter"],"funder":[{"@type":"Organization","url":"https://github.com/sponsors/vardius"}],"https://www.w3.org/ns/activitystreams#likes":146,"https://forgefed.org/ns#forks":16}