Documentation ¶
Index ¶
- func Bind[I any, O any](b *Binding, item *BindItem[I, O], middlewares ...middleware.Func)
- func DeleteBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
- func Destroy()
- func GetBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
- func GetRouter() *gin.Engine
- func Init(apiUrlPrefix string, port string)
- func PostBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
- func PutBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
- func Static(b *Binding, item *StaticBindItem)
- func StaticFile(b *Binding, item *StaticFileBindItem)
- type BindItem
- type Binding
- type BindingFunc
- type BusinessFunc
- type HandleFunc
- type SimpleBindItem
- type StaticBindItem
- type StaticFileBindItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteBind ¶
func DeleteBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
func GetBind ¶
func GetBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
func PostBind ¶
func PostBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
func PutBind ¶
func PutBind[I any, O any](b *Binding, item *SimpleBindItem[I, O], middlewares ...middleware.Func)
func Static ¶
func Static(b *Binding, item *StaticBindItem)
func StaticFile ¶ added in v1.2.6
func StaticFile(b *Binding, item *StaticFileBindItem)
Types ¶
type BindItem ¶
type BindItem[I any, O any] struct { Method string *SimpleBindItem[I, O] }
BindItem 路由条目结构
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
func NewBinding ¶
func NewBinding(apiVersion string, middlewares ...middleware.Func) *Binding
NewBinding 创建版本对应的binding
func (*Binding) AddHandler ¶ added in v1.2.5
func (binding *Binding) AddHandler(method string, relativePath string, handleFunctions ...HandleFunc) error
type BindingFunc ¶
type BusinessFunc ¶
type BusinessFunc[I any, O any] func(c *binding_context.Context, inputModel I) (O, error)
type HandleFunc ¶ added in v1.2.5
type HandleFunc func(c *binding_context.Context)
type SimpleBindItem ¶
type SimpleBindItem[I any, O any] struct { Path string // 请求路径 ResponseFunc response.SendFunc[O] // 响应泛型函数 BusinessFunc BusinessFunc[I, O] // 业务泛型函数 OptionalBindingFunc BindingFunc[O] // 可选的绑定函数 }
SimpleBindItem 路由条目
type StaticBindItem ¶
StaticBindItem 静态路由item
type StaticFileBindItem ¶ added in v1.2.6
Click to show internal directories.
Click to hide internal directories.