Documentation ¶
Index ¶
- Constants
- func ModuleBuilder() *moduleBuilder
- type App
- func (app *App) BindGlobalExceptionFilters(exceptionFilters ...common.ExceptionFilterable) *App
- func (app *App) BindGlobalGuards(guarders ...common.Guarder) *App
- func (app *App) BindGlobalInterceptors(interceptors ...common.Interceptable) *App
- func (app *App) Create(m *Module)
- func (app *App) EnableVersioning(v versioning.Versioning) *App
- func (app *App) For(route string) func(handlers ...ctx.Handler) *App
- func (app *App) Get(p Provider) any
- func (app *App) Listen(port int) error
- func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (app *App) Use(handlers ...ctx.Handler) *App
- func (app *App) UseLogger(logger common.Logger) *App
- type Controller
- type Middleware
- type Module
- type Provider
- type RESTCommonLayer
- type RESTMiddlewareLayer
- type WSCommonLayer
- type WSMiddlewareLayer
- type WithValueKey
Constants ¶
View Source
const ( CONTEXT = "/*ctx.Context" WS_CONNECTION = "/*websocket.Conn" REQUEST = "/*http.Request" RESPONSE = "net/http/http.ResponseWriter" BODY = "github.com/dangduoc08/gogo/ctx/ctx.Body" FORM = "github.com/dangduoc08/gogo/ctx/ctx.Form" QUERY = "github.com/dangduoc08/gogo/ctx/ctx.Query" HEADER = "github.com/dangduoc08/gogo/ctx/ctx.Header" PARAM = "github.com/dangduoc08/gogo/ctx/ctx.Param" FILE = "github.com/dangduoc08/gogo/ctx/ctx.File" WS_PAYLOAD = "github.com/dangduoc08/gogo/ctx/ctx.WSPayload" NEXT = "/func()" REDIRECT = "/func(string)" CONTEXT_PIPEABLE = "context" BODY_PIPEABLE = "body" FORM_PIPEABLE = "form" QUERY_PIPEABLE = "query" HEADER_PIPEABLE = "header" PARAM_PIPEABLE = "param" FILE_PIPEABLE = "file" WS_PAYLOAD_PIPEABLE = "wsPayload" )
link to aliases
Variables ¶
This section is empty.
Functions ¶
func ModuleBuilder ¶
func ModuleBuilder() *moduleBuilder
Types ¶
type App ¶
func (*App) BindGlobalExceptionFilters ¶
func (app *App) BindGlobalExceptionFilters(exceptionFilters ...common.ExceptionFilterable) *App
func (*App) BindGlobalInterceptors ¶
func (app *App) BindGlobalInterceptors(interceptors ...common.Interceptable) *App
func (*App) EnableVersioning ¶
func (app *App) EnableVersioning(v versioning.Versioning) *App
type Controller ¶
type Controller interface {
NewController() Controller
}
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func (*Middleware) Apply ¶
func (mw *Middleware) Apply(middleware ctx.Handler, handlers ...any) *Middleware
type Module ¶
type Module struct { *sync.Mutex Middleware *Middleware IsGlobal bool OnInit func() // store REST module middlewares RESTMiddlewares []RESTMiddlewareLayer // store REST module guards RESTGuards []RESTCommonLayer // store REST module interceptors RESTInterceptors []RESTCommonLayer // store REST module exception filters RESTExceptionFilters []RESTCommonLayer // store REST main handlers RESTMainHandlers []RESTCommonLayer // store WS module middlewares WSMiddlewares []struct { Subprotocol string EventName string Handlers []ctx.Handler // contains filtered or unexported fields } // store WS module guards WSGuards []struct { Subprotocol string EventName string Handler any } // store WS module interceptors WSInterceptors []struct { Subprotocol string EventName string Handler any } // store WS module exception filters WSExceptionFilters []struct { Subprotocol string EventName string Handler any } // store WS main handlers WSMainHandlers []struct { Subprotocol string EventName string Handler any } // contains filtered or unexported fields }
type RESTCommonLayer ¶
type RESTMiddlewareLayer ¶
type WSCommonLayer ¶
type WSMiddlewareLayer ¶
type WithValueKey ¶
type WithValueKey string
Click to show internal directories.
Click to hide internal directories.