Versions in this module Expand all Collapse all v1 v1.0.5 Oct 11, 2020 Changes in this version + const CharsetUTF8 + const DefaultWildCardName + const EchoPathStyle + const GinPathStyle + const HeaderContentDisposition + const HeaderContentType + const HeaderXForwardedProto + const HeaderXForwardedProtocol + const HeaderXForwardedSsl + const HeaderXUrlScheme + const JavaPathStyle + const MIMEApplicationForm + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationJavaScript + const MIMEApplicationJavaScriptCharsetUTF8 + const MIMEApplicationMsgpack + const MIMEApplicationProtobuf + const MIMEApplicationXML + const MIMEApplicationXMLCharsetUTF8 + const MIMEImageGif + const MIMEImageJpeg + const MIMEImagePng + const MIMEJsonAPI + const MIMEJsonStream + const MIMEMultipartForm + const MIMEOctetStream + const MIMETextHTML + const MIMETextHTMLCharsetUTF8 + const MIMETextPlain + const MIMETextPlainCharsetUTF8 + const MIMETextXML + const MIMETextXMLCharsetUTF8 + const MethodAny + const MethodConnect + const MethodDelete + const MethodGet + const MethodGetPost + const MethodHead + const MethodOptions + const MethodPatch + const MethodPost + const MethodPut + const MethodTrace + const WebContextKey + var RpcInvoke = defaultRpcInvoke + func BodyParam(name string, schema *spec.Schema) *spec.Parameter + func GetMethod(method uint32) []string + func HeaderParam(name string, typ, format string) *spec.Parameter + func InvokeHandler(ctx WebContext, fn Handler, filters []Filter) + func NewBindResponse(i interface{}, description string) *spec.Response + func NewDefaultValidator() *defaultValidator + func NewDefaultWebMapping() *defaultWebMapping + func NewResponse(description string) *spec.Response + func PathParam(name string, typ, format string) *spec.Parameter + func ReDoc(ctx WebContext) + func ToPathStyle(path string, style PathStyleEnum) (string, string) + func Validate(i interface{}) error + type BaseWebContainer struct + func NewBaseWebContainer(config ContainerConfig) *BaseWebContainer + func (c *BaseWebContainer) AddFilter(filter ...Filter) + func (c *BaseWebContainer) AddRouter(router *Router) + func (c *BaseWebContainer) Address() string + func (c *BaseWebContainer) Config() ContainerConfig + func (c *BaseWebContainer) EnableSwagger() bool + func (c *BaseWebContainer) GetErrorCallback() func(error) + func (c *BaseWebContainer) GetFilters() []Filter + func (c *BaseWebContainer) GetLoggerFilter() Filter + func (c *BaseWebContainer) GetRecoveryFilter() Filter + func (c *BaseWebContainer) PreStart() + func (c *BaseWebContainer) PrintMapper(m *Mapper) + func (c *BaseWebContainer) ResetFilters(filters []Filter) + func (c *BaseWebContainer) SetEnableSwagger(enable bool) + func (c *BaseWebContainer) SetErrorCallback(fn func(error)) + func (c *BaseWebContainer) SetLoggerFilter(filter Filter) + func (c *BaseWebContainer) SetRecoveryFilter(filter Filter) + func (c *BaseWebContainer) Swagger() *Swagger + type ContainerConfig struct + CertFile string + EnableSSL bool + IP string + KeyFile string + Port int + ReadTimeout time.Duration + WriteTimeout time.Duration + type DefaultFilterChain struct + func NewDefaultFilterChain(filters []Filter) *DefaultFilterChain + func (chain *DefaultFilterChain) Next(ctx WebContext) + type DefinitionField struct + Description string + Enums []interface{} + Example interface{} + type Filter interface + Invoke func(ctx WebContext, chain FilterChain) + func HandlerFilter(fn Handler) Filter + type FilterChain interface + Next func(ctx WebContext) + type Handler interface + FileLine func() (file string, line int, fnName string) + Invoke func(WebContext) + func BIND(fn interface{}) Handler + func FUNC(fn HandlerFunc) Handler + func HTTP(fn http.HandlerFunc) Handler + func WrapF(fn http.HandlerFunc) Handler + func WrapH(h http.Handler) Handler + type HandlerFunc func(WebContext) + type Mapper struct + func NewMapper(method uint32, path string, fn Handler, filters []Filter) *Mapper + func (m *Mapper) Filters() []Filter + func (m *Mapper) GetSwagger() *Operation + func (m *Mapper) Handler() Handler + func (m *Mapper) Key() string + func (m *Mapper) Method() uint32 + func (m *Mapper) Path() string + func (m *Mapper) Swagger(id string) *Operation + func (m *Mapper) WithSwagger(swagger *Operation) *Mapper + type Operation struct + func NewOperation(id string) *Operation + func (o *Operation) AddParam(param *spec.Parameter) *Operation + func (o *Operation) BindParam(i interface{}, description string) *Operation + func (o *Operation) Deprecate() *Operation + func (o *Operation) RemoveParam(name, in string) *Operation + func (o *Operation) RespondsWith(code int, response *spec.Response) *Operation + func (o *Operation) SecuredWith(name string, scopes ...string) *Operation + func (o *Operation) Undeprecate() *Operation + func (o *Operation) WithConsumes(mediaTypes ...string) *Operation + func (o *Operation) WithDefaultResponse(response *spec.Response) *Operation + func (o *Operation) WithDescription(description string) *Operation + func (o *Operation) WithExternalDocs(description, url string) *Operation + func (o *Operation) WithID(id string) *Operation + func (o *Operation) WithProduces(mediaTypes ...string) *Operation + func (o *Operation) WithSchemes(schemes ...string) *Operation + func (o *Operation) WithSummary(summary string) *Operation + func (o *Operation) WithTags(tags ...string) *Operation + type PathStyleEnum int + type ResponseWriter interface + Size func() int + Status func() int + type Router struct + func NewRouter(basePath string, filters ...Filter) *Router + func (r *Router) Route(basePath string, filters ...Filter) *Router + type Swagger struct + func NewSwagger() *Swagger + func (s *Swagger) AddApiKeySecurityDefinition(name string, in string) *Swagger + func (s *Swagger) AddBasicSecurityDefinition() *Swagger + func (s *Swagger) AddDefinition(name string, schema *spec.Schema) *Swagger + func (s *Swagger) AddOauth2AccessCodeSecurityDefinition(name string, authorizationUrl string, tokenUrl string, ...) *Swagger + func (s *Swagger) AddOauth2ApplicationSecurityDefinition(name string, tokenUrl string, scopes map[string]string) *Swagger + func (s *Swagger) AddOauth2ImplicitSecurityDefinition(name string, authorizationUrl string, scopes map[string]string) *Swagger + func (s *Swagger) AddOauth2PasswordSecurityDefinition(name string, tokenUrl string, scopes map[string]string) *Swagger + func (s *Swagger) AddPath(path string, method uint32, op *Operation, parameters ...spec.Parameter) *Swagger + func (s *Swagger) BindDefinitionWithTags(i interface{}, attachFields map[string]DefinitionField) *Swagger + func (s *Swagger) BindDefinitions(i ...interface{}) *Swagger + func (s *Swagger) ReadDoc() string + func (s *Swagger) WithBasePath(basePath string) *Swagger + func (s *Swagger) WithConsumes(consumes ...string) *Swagger + func (s *Swagger) WithContact(name string, url string, email string) *Swagger + func (s *Swagger) WithDescription(description string) *Swagger + func (s *Swagger) WithExternalDocs(externalDocs *spec.ExternalDocumentation) *Swagger + func (s *Swagger) WithHost(host string) *Swagger + func (s *Swagger) WithID(id string) *Swagger + func (s *Swagger) WithLicense(name string, url string) *Swagger + func (s *Swagger) WithProduces(produces ...string) *Swagger + func (s *Swagger) WithSchemes(schemes ...string) *Swagger + func (s *Swagger) WithTags(tags ...spec.Tag) *Swagger + func (s *Swagger) WithTermsOfService(termsOfService string) *Swagger + func (s *Swagger) WithTitle(title string) *Swagger + func (s *Swagger) WithVersion(version string) *Swagger + type UrlRegister interface + DeleteBinding func(path string, fn interface{}, filters ...Filter) *Mapper + DeleteMapping func(path string, fn HandlerFunc, filters ...Filter) *Mapper + GetBinding func(path string, fn interface{}, filters ...Filter) *Mapper + GetMapping func(path string, fn HandlerFunc, filters ...Filter) *Mapper + HandleDelete func(path string, fn Handler, filters ...Filter) *Mapper + HandleGet func(path string, fn Handler, filters ...Filter) *Mapper + HandlePost func(path string, fn Handler, filters ...Filter) *Mapper + HandlePut func(path string, fn Handler, filters ...Filter) *Mapper + PostBinding func(path string, fn interface{}, filters ...Filter) *Mapper + PostMapping func(path string, fn HandlerFunc, filters ...Filter) *Mapper + PutBinding func(path string, fn interface{}, filters ...Filter) *Mapper + PutMapping func(path string, fn HandlerFunc, filters ...Filter) *Mapper + Request func(method uint32, path string, fn Handler, filters ...Filter) *Mapper + RequestBinding func(method uint32, path string, fn interface{}, filters ...Filter) *Mapper + RequestMapping func(method uint32, path string, fn HandlerFunc, filters ...Filter) *Mapper + Route func(basePath string, filters ...Filter) *Router + type WebContainer interface + AddFilter func(filter ...Filter) + AddRouter func(router *Router) + Config func() ContainerConfig + EnableSwagger func() bool + GetErrorCallback func() func(error) + GetFilters func() []Filter + GetLoggerFilter func() Filter + GetRecoveryFilter func() Filter + ResetFilters func(filters []Filter) + SetEnableSwagger func(enable bool) + SetErrorCallback func(fn func(error)) + SetLoggerFilter func(filter Filter) + SetRecoveryFilter func(filter Filter) + Start func() + Stop func(ctx context.Context) + Swagger func() *Swagger + type WebContext interface + Abort func() + Attachment func(file string, name string) error + Bind func(i interface{}) error + Blob func(code int, contentType string, b []byte) error + ClientIP func() string + ContentType func() string + Cookie func(name string) (*http.Cookie, error) + Cookies func() []*http.Cookie + File func(file string) error + FormFile func(name string) (*multipart.FileHeader, error) + FormParams func() (url.Values, error) + FormValue func(name string) string + Get func(key string) interface{} + GetHeader func(key string) string + GetRawData func() ([]byte, error) + HTML func(code int, html string) error + HTMLBlob func(code int, b []byte) error + Handler func() Handler + Header func(key, value string) + Inline func(file string, name string) error + IsAborted func() bool + IsTLS func() bool + IsWebSocket func() bool + JSON func(code int, i interface{}) error + JSONBlob func(code int, b []byte) error + JSONP func(code int, callback string, i interface{}) error + JSONPBlob func(code int, callback string, b []byte) error + JSONPretty func(code int, i interface{}, indent string) error + MultipartForm func() (*multipart.Form, error) + NativeContext func() interface{} + NoContent func(code int) + Path func() string + PathParam func(name string) string + PathParamNames func() []string + PathParamValues func() []string + QueryParam func(name string) string + QueryParams func() url.Values + QueryString func() string + Redirect func(code int, url string) error + Request func() *http.Request + ResponseWriter func() ResponseWriter + SSEvent func(name string, message interface{}) error + SaveUploadedFile func(file *multipart.FileHeader, dst string) error + Scheme func() string + Set func(key string, val interface{}) + SetCookie func(cookie *http.Cookie) + SetRequest func(r *http.Request) + Status func(code int) + Stream func(code int, contentType string, r io.Reader) error + String func(code int, format string, values ...interface{}) error + XML func(code int, i interface{}) error + XMLBlob func(code int, b []byte) error + XMLPretty func(code int, i interface{}, indent string) error + type WebMapping interface + AddMapper func(m *Mapper) *Mapper + Mappers func() map[string]*Mapper + type WebServer struct + func NewWebServer() *WebServer + func (s *WebServer) AddContainer(container ...WebContainer) *WebServer + func (s *WebServer) AddFilter(filter ...Filter) *WebServer + func (s *WebServer) Containers() []WebContainer + func (s *WebServer) Filters() []Filter + func (s *WebServer) GetLoggerFilter() Filter + func (s *WebServer) GetRecoveryFilter() Filter + func (s *WebServer) ResetFilters(filters []Filter) + func (s *WebServer) SetErrorCallback(fn func(error)) *WebServer + func (s *WebServer) SetLoggerFilter(filter Filter) *WebServer + func (s *WebServer) SetRecoveryFilter(filter Filter) *WebServer + func (s *WebServer) Start() + func (s *WebServer) Stop(ctx context.Context) + type WebValidator interface + Engine func() interface{} + Validate func(i interface{}) error + var Validator WebValidator v1.0.5-rc2 Oct 9, 2020 v1.0.5-rc1 Sep 4, 2020 v1.0.5-rc Aug 9, 2020