Documentation ¶
Index ¶
- func NewHttpGin(opts ...Option) toybox.Option
- type HttpGinServer
- func (hgs *HttpGinServer) DELETE(relativePath string, handlers ...gin.HandlerFunc)
- func (hgs *HttpGinServer) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool)
- func (hgs *HttpGinServer) Engine() *gin.Engine
- func (hgs *HttpGinServer) GET(relativePath string, handlers ...gin.HandlerFunc)
- func (hgs *HttpGinServer) Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
- func (hgs *HttpGinServer) Handle(method, path string, handlers ...gin.HandlerFunc)
- func (hgs *HttpGinServer) IsReady()
- func (hgs *HttpGinServer) Name() string
- func (hgs *HttpGinServer) POST(relativePath string, handlers ...gin.HandlerFunc)
- func (hgs *HttpGinServer) PUT(relativePath string, handlers ...gin.HandlerFunc)
- func (hgs *HttpGinServer) Ready() bool
- func (hgs *HttpGinServer) Run(ctx context.Context) error
- func (hgs *HttpGinServer) Use(middleware ...gin.HandlerFunc)
- type Option
- func WithHandlers(cols ...ginsvr.Handler) Option
- func WithMaxHeaderBytes(maxHeaderBytes int) Option
- func WithMiddleware(mids ...gin.HandlerFunc) Option
- func WithName(name string) Option
- func WithPort(port string) Option
- func WithReadTimeout(readTimeout int) Option
- func WithTLS(cert, key string) Option
- func WithValidator(valid ...validaton.Validaton) Option
- func WithWriteTimeout(writeTimeout int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHttpGin ¶
Types ¶
type HttpGinServer ¶
type HttpGinServer struct { Port string `toml:"port" json:"port"` ReadTimeout int `toml:"read_timeout" json:"read_timeout"` WriteTimeout int `toml:"write_timeout" json:"write_timeout"` MaxHeaderBytes int `toml:"max_header_bytes" json:"max_header_bytes"` TLS bool `toml:"tls" json:"tls"` Cert string `toml:"cert" json:"cert"` Key string `toml:"key" json:"key"` // contains filtered or unexported fields }
func (*HttpGinServer) DELETE ¶
func (hgs *HttpGinServer) DELETE(relativePath string, handlers ...gin.HandlerFunc)
func (*HttpGinServer) Do ¶
func (hgs *HttpGinServer) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool)
func (*HttpGinServer) Engine ¶
func (hgs *HttpGinServer) Engine() *gin.Engine
func (*HttpGinServer) GET ¶
func (hgs *HttpGinServer) GET(relativePath string, handlers ...gin.HandlerFunc)
func (*HttpGinServer) Group ¶
func (hgs *HttpGinServer) Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
func (*HttpGinServer) Handle ¶
func (hgs *HttpGinServer) Handle(method, path string, handlers ...gin.HandlerFunc)
func (*HttpGinServer) IsReady ¶
func (hgs *HttpGinServer) IsReady()
func (*HttpGinServer) Name ¶
func (hgs *HttpGinServer) Name() string
func (*HttpGinServer) POST ¶
func (hgs *HttpGinServer) POST(relativePath string, handlers ...gin.HandlerFunc)
func (*HttpGinServer) PUT ¶
func (hgs *HttpGinServer) PUT(relativePath string, handlers ...gin.HandlerFunc)
func (*HttpGinServer) Ready ¶
func (hgs *HttpGinServer) Ready() bool
func (*HttpGinServer) Use ¶
func (hgs *HttpGinServer) Use(middleware ...gin.HandlerFunc)
type Option ¶
type Option func(*HttpGinServer)
func WithHandlers ¶
func WithMaxHeaderBytes ¶
func WithMiddleware ¶
func WithMiddleware(mids ...gin.HandlerFunc) Option
func WithReadTimeout ¶
func WithValidator ¶ added in v1.2.2
func WithWriteTimeout ¶
Click to show internal directories.
Click to hide internal directories.