Documentation
¶
Index ¶
- func RegisterAutoRegistrar(reg AutoRegistrar)
- type AutoRegistrar
- type BindSource
- type Engine
- func (e *Engine) Build() error
- func (e *Engine) Container() inject.Injector
- func (e *Engine) EmbedProject(data []byte)
- func (e *Engine) ListenAndServe() error
- func (e *Engine) RegisterController(controller any)
- func (e *Engine) RegisterMiddleware(mw middleware.Middleware)
- func (e *Engine) SetResponse(formatter response.Formatter, encoder response.Encoder)
- func (e *Engine) Use(mw middleware.Middleware)
- type ParamHint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAutoRegistrar ¶
func RegisterAutoRegistrar(reg AutoRegistrar)
Types ¶
type AutoRegistrar ¶
type BindSource ¶
type BindSource string
const ( BindAuto BindSource = "auto" BindQuery BindSource = "query" BindPath BindSource = "path" BindHeader BindSource = "header" BindBody BindSource = "body" )
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) EmbedProject ¶
EmbedProject sets pre-generated AST metadata (the contents of .astp.json). When set, Build() uses this data instead of parsing Go source files at runtime.
Typical usage with go:generate + go:embed:
//go:generate go run github.com/linxlib/fw/v2/astp/cmd/astp -exported .
//go:embed .astp.json
var astpData []byte
func main() {
e, _ := app.New("")
e.EmbedProject(astpData)
// ...
}
func (*Engine) ListenAndServe ¶
func (*Engine) RegisterController ¶
func (*Engine) RegisterMiddleware ¶
func (e *Engine) RegisterMiddleware(mw middleware.Middleware)
func (*Engine) SetResponse ¶
func (*Engine) Use ¶
func (e *Engine) Use(mw middleware.Middleware)
type ParamHint ¶
type ParamHint struct {
Name string
Source BindSource
}
Click to show internal directories.
Click to hide internal directories.