Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultRPCEndpoint = "/api" FormKeyParams = "params" FormKeyMeta = "meta" )
View Source
const (
DefaultRESTBasePath = "/api"
)
Variables ¶
View Source
var Module = fx.Module( "vef:api:router", fx.Provide( fx.Annotate( func(chain *middleware.Chain) api.RouterStrategy { return NewRPC(DefaultRPCEndpoint, chain) }, fx.ResultTags(`group:"vef:api:router_strategies"`), ), fx.Annotate( func(chain *middleware.Chain) api.RouterStrategy { return NewREST(DefaultRESTBasePath, chain) }, fx.ResultTags(`group:"vef:api:router_strategies"`), ), ), )
Functions ¶
func NewREST ¶
func NewREST(basePath string, chain *middleware.Chain) api.RouterStrategy
NewREST creates a new RESTful router.
func NewRPC ¶
func NewRPC(path string, chain *middleware.Chain) api.RouterStrategy
NewRPC creates a new RPC-style router. If path is empty, defaults to "/api".
Types ¶
type REST ¶
type REST struct {
// contains filtered or unexported fields
}
REST implements api.RouterStrategy for RESTful routing.
Click to show internal directories.
Click to hide internal directories.