app

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAutoRegistrar

func RegisterAutoRegistrar(reg AutoRegistrar)

Types

type AutoRegistrar

type AutoRegistrar func(*Engine) error

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 New

func New(configPath string) (*Engine, error)

func (*Engine) Build

func (e *Engine) Build() error

func (*Engine) Container

func (e *Engine) Container() inject.Injector

func (*Engine) EmbedProject

func (e *Engine) EmbedProject(data []byte)

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 (e *Engine) ListenAndServe() error

func (*Engine) RegisterController

func (e *Engine) RegisterController(controller any)

func (*Engine) RegisterMiddleware

func (e *Engine) RegisterMiddleware(mw middleware.Middleware)

func (*Engine) SetResponse

func (e *Engine) SetResponse(formatter response.Formatter, encoder response.Encoder)

func (*Engine) Use

func (e *Engine) Use(mw middleware.Middleware)

type ParamHint

type ParamHint struct {
	Name   string
	Source BindSource
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL