mux

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 23 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTP

func HTTP(callback Callback) cago.ComponentCancel

HTTP http服务组件,需要先注册logger组件

func Recover

func Recover() gin.HandlerFunc

func RegisterMiddleware

func RegisterMiddleware(f RegisterMiddlewareFunc)

func ShouldBindWith

func ShouldBindWith(c *gin.Context, obj any) error

Types

type Callback

type Callback func(ctx context.Context, r *Router) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL string) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req any, resp any, opts ...ClientOption) error

func (*Client) HttpDo

func (c *Client) HttpDo(httpReq *http.Request, resp any) error

func (*Client) Request

func (c *Client) Request(ctx context.Context, req any, opts ...ClientOption) (*http.Request, error)

type ClientOption

type ClientOption func(*ClientOptions)

func WithPath

func WithPath(path string) ClientOption

type ClientOptions

type ClientOptions struct {
	// contains filtered or unexported fields
}

func NewDoOptions

func NewDoOptions(opts ...ClientOption) *ClientOptions

type Config

type Config struct {
	Address []string `yaml:"address"`
}

type Meta

type Meta struct {
}

Meta 路由

type RegisterMiddlewareFunc

type RegisterMiddlewareFunc func(cfg *configs.Config, router *gin.Engine) error

type Router

type Router struct {
	gin.IRouter
}

func (*Router) Bind

func (r *Router) Bind(handler ...interface{})

Bind 绑定控制器

func (*Router) Group

func (r *Router) Group(path string, handler ...gin.HandlerFunc) *Router

type Validate

type Validate interface {
	Validate(ctx context.Context) error
}

Validate 数据校验

Jump to

Keyboard shortcuts

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