Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RouteCtxKey is the context.Context key to store the request context. RouteCtxKey = context.NewContextKey("RouteContext") )
Functions ¶
func WithRouteContext ¶
func WithRouteContext(ctx context.Context, rctx *RoutingContext) context.Context
WithRouteContext returns a new http.Request Context with a given mix routing Context object connected to it, so it can later be extracted using RouteContext()
Types ¶
type RoutingContext ¶ added in v0.33.0
func NewRouteContext ¶
func NewRouteContext(prefix, path string) *RoutingContext
NewRouteContext returns a new RoutingContext object.
func RouteContext ¶
func RouteContext(ctx context.Context) *RoutingContext
RouteContext returns a RoutingContext object from a http.Request Context.
func (RoutingContext) Clone ¶ added in v0.33.0
func (rctx RoutingContext) Clone() *RoutingContext
Clone() creates a copy of a RoutingContext object
func (*RoutingContext) Init ¶ added in v0.33.0
func (rctx *RoutingContext) Init(prefix, path string)
func (*RoutingContext) Next ¶ added in v0.33.0
func (rctx *RoutingContext) Next() (*RoutingContext, string)
func (*RoutingContext) Path ¶ added in v0.33.0
func (rctx *RoutingContext) Path() string
func (*RoutingContext) Step ¶ added in v0.33.0
func (rctx *RoutingContext) Step(prefix string) *RoutingContext
Click to show internal directories.
Click to hide internal directories.