Documentation
¶
Index ¶
- Constants
- func Var(r *http.Request, key string) (string, bool)
- func Vars(r *http.Request) map[string]string
- func WithDescription(desc string) interface{}
- func WithFileSystem(fs http.FileSystem) interface{}
- func WithFileSystemPath(root string) interface{}
- func WithHide(hide bool) interface{}
- func WithInterceptor(fn func(handler func(ctx Context) error) func(ctx Context) error) interface{}
- func WithPathFormat(format PathFormat) interface{}
- type Context
- type Interceptor
- type LogConfig
- type PathFormat
- type Response
- type ResponseGetter
- type Router
- type RouterManager
- type RouterTx
Constants ¶
View Source
const ( PathFormatEcho = 0 PathFormatGoogleAPIs = 1 )
PathFormat values
Variables ¶
This section is empty.
Functions ¶
func Var ¶ added in v1.0.8
Var return the specified variable value and exist from the current request, if any.
func WithDescription ¶
func WithDescription(desc string) interface{}
WithDescription for Route, description for this route
func WithFileSystem ¶
func WithFileSystem(fs http.FileSystem) interface{}
WithFileSystem for Static And File
func WithFileSystemPath ¶
func WithFileSystemPath(root string) interface{}
WithFileSystemPath for Static And File
func WithInterceptor ¶
WithInterceptor for Router
Types ¶
type Context ¶
type Context interface {
SetAttribute(key string, val interface{})
Attribute(key string) interface{}
Attributes() map[string]interface{}
Request() *http.Request
ResponseWriter() http.ResponseWriter
Param(name string) string
ParamNames() []string
}
Context handler context.
type Interceptor ¶
Interceptor .
type LogConfig ¶ added in v1.0.8
type LogConfig struct {
MaxBodySizeBytes int `file:"max_body_size_bytes" default:"1024" desc:"max body size in bytes"`
}
LogConfig .
type Response ¶
type Response interface {
Status(Context) int
ReadCloser(Context) io.ReadCloser
Error(Context) error
}
Response .
type ResponseGetter ¶
ResponseGetter .
type Router ¶
type Router interface {
GET(path string, handler interface{}, options ...interface{})
POST(path string, handler interface{}, options ...interface{})
DELETE(path string, handler interface{}, options ...interface{})
PUT(path string, handler interface{}, options ...interface{})
PATCH(path string, handler interface{}, options ...interface{})
HEAD(path string, handler interface{}, options ...interface{})
CONNECT(path string, handler interface{}, options ...interface{})
OPTIONS(path string, handler interface{}, options ...interface{})
TRACE(path string, handler interface{}, options ...interface{})
Any(path string, handler interface{}, options ...interface{})
Static(prefix, root string, options ...interface{})
File(path, filepath string, options ...interface{})
Add(method, path string, handler interface{}, options ...interface{}) error
}
Router .
type RouterManager ¶
type RouterManager interface {
NewRouter(opts ...interface{}) RouterTx
Reloadable() bool
Started() <-chan struct{}
}
RouterManager .
Click to show internal directories.
Click to hide internal directories.