Documentation ¶
Index ¶
- Constants
- type Api
- type Context
- func (c *Context) GetAllPathParams() map[string]string
- func (c *Context) GetAllQueryParams() map[string]string
- func (c *Context) GetFileHeaderBytes(fileHeader *multipart.FileHeader) (string, []byte, error)
- func (c *Context) GetHeaders() map[string]string
- func (c *Context) GetTenantInfo() TenantInfo
- func (c *Context) GetUserInfo() UserInfo
- func (c *Context) ReadBody() ([]byte, error)
- func (c *Context) ReadJsonBody(output any) error
- func (c *Context) ReplaceBody(body []byte) error
- func (c *Context) ReplaceJsonBody(body any) error
- type Handler
- type Option
- type Options
- type PrefixRouter
- func (r *PrefixRouter) AddMiddlewares(middlewares ...Handler) Router
- func (r *PrefixRouter) AddRoute(method string, relativePath string, middlewares ...Handler) Router
- func (r *PrefixRouter) BasePath() string
- func (r *PrefixRouter) RegisterVersionedRouter(version string, middlewares ...Handler) Router
- func (r *PrefixRouter) Static(relativePath string, root string)
- func (r *PrefixRouter) StaticFile(relativePath string, filepath string)
- func (r *PrefixRouter) VersionedRouter(version string) Router
- type RootRouter
- func (r *RootRouter) AddMiddlewares(middlewares ...Handler) Router
- func (r *RootRouter) AddRoute(method string, relativePath string, middlewares ...Handler) Router
- func (r *RootRouter) BasePath() string
- func (r *RootRouter) RegisterVersionedRouter(version string, middlewares ...Handler) Router
- func (r *RootRouter) ServerHttp(w http.ResponseWriter, req *http.Request)
- func (r *RootRouter) Static(relativePath string, root string)
- func (r *RootRouter) StaticFile(relativePath string, filepath string)
- func (r *RootRouter) VersionedRouter(version string) Router
- type Router
- type TenantInfo
- type UserInfo
Constants ¶
View Source
const ( RouterRoot = "root" RouterPrefix = "prefix" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func NewWithEngine ¶ added in v0.3.0
func (*Api) ChooseRouter ¶ added in v0.2.2
func (*Api) PrefixRouter ¶
func (*Api) RootRouter ¶
type Context ¶
func (*Context) GetAllPathParams ¶ added in v0.3.0
func (*Context) GetAllQueryParams ¶ added in v0.3.0
func (*Context) GetFileHeaderBytes ¶
GetFileHeaderBytes 获取传递的文件名和文件内容
func (*Context) GetHeaders ¶ added in v0.3.0
func (*Context) GetTenantInfo ¶ added in v0.4.0
func (c *Context) GetTenantInfo() TenantInfo
func (*Context) GetUserInfo ¶ added in v0.4.0
func (*Context) ReadJsonBody ¶ added in v0.4.0
func (*Context) ReplaceBody ¶ added in v0.3.0
func (*Context) ReplaceJsonBody ¶ added in v0.4.0
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (Options) GetUrlPrefix ¶
type PrefixRouter ¶
type PrefixRouter struct {
// contains filtered or unexported fields
}
func (*PrefixRouter) AddMiddlewares ¶
func (r *PrefixRouter) AddMiddlewares(middlewares ...Handler) Router
func (*PrefixRouter) AddRoute ¶
func (r *PrefixRouter) AddRoute(method string, relativePath string, middlewares ...Handler) Router
func (*PrefixRouter) BasePath ¶
func (r *PrefixRouter) BasePath() string
func (*PrefixRouter) RegisterVersionedRouter ¶
func (r *PrefixRouter) RegisterVersionedRouter(version string, middlewares ...Handler) Router
func (*PrefixRouter) Static ¶
func (r *PrefixRouter) Static(relativePath string, root string)
func (*PrefixRouter) StaticFile ¶
func (r *PrefixRouter) StaticFile(relativePath string, filepath string)
func (*PrefixRouter) VersionedRouter ¶
func (r *PrefixRouter) VersionedRouter(version string) Router
type RootRouter ¶
type RootRouter struct {
// contains filtered or unexported fields
}
func (*RootRouter) AddMiddlewares ¶
func (r *RootRouter) AddMiddlewares(middlewares ...Handler) Router
func (*RootRouter) AddRoute ¶
func (r *RootRouter) AddRoute(method string, relativePath string, middlewares ...Handler) Router
func (*RootRouter) BasePath ¶
func (r *RootRouter) BasePath() string
func (*RootRouter) RegisterVersionedRouter ¶
func (r *RootRouter) RegisterVersionedRouter(version string, middlewares ...Handler) Router
func (*RootRouter) ServerHttp ¶
func (r *RootRouter) ServerHttp(w http.ResponseWriter, req *http.Request)
func (*RootRouter) Static ¶
func (r *RootRouter) Static(relativePath string, root string)
func (*RootRouter) StaticFile ¶
func (r *RootRouter) StaticFile(relativePath string, filepath string)
func (*RootRouter) VersionedRouter ¶
func (r *RootRouter) VersionedRouter(version string) Router
type Router ¶
type Router interface { AddMiddlewares(middlewares ...Handler) Router RegisterVersionedRouter(version string, middlewares ...Handler) Router VersionedRouter(version string) Router AddRoute(method string, relativePath string, middlewares ...Handler) Router Static(relativePath string, root string) StaticFile(relativePath string, filepath string) BasePath() string }
type TenantInfo ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.