http2gin

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttp2

func NewHttp2(opts ...Option) toybox.Option

Types

type Http2GinServer

type Http2GinServer 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 (*Http2GinServer) DELETE

func (hgs *Http2GinServer) DELETE(relativePath string, handlers ...gin.HandlerFunc)

func (*Http2GinServer) Do

func (hgs *Http2GinServer) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool)

func (*Http2GinServer) Engine

func (hgs *Http2GinServer) Engine() *gin.Engine

func (*Http2GinServer) GET

func (hgs *Http2GinServer) GET(relativePath string, handlers ...gin.HandlerFunc)

func (*Http2GinServer) Group

func (hgs *Http2GinServer) Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup

func (*Http2GinServer) Handle

func (hgs *Http2GinServer) Handle(method, path string, handlers ...gin.HandlerFunc)

func (*Http2GinServer) IsReady

func (hgs *Http2GinServer) IsReady()

func (*Http2GinServer) Name

func (h2gs *Http2GinServer) Name() string

func (*Http2GinServer) POST

func (hgs *Http2GinServer) POST(relativePath string, handlers ...gin.HandlerFunc)

func (*Http2GinServer) PUT

func (hgs *Http2GinServer) PUT(relativePath string, handlers ...gin.HandlerFunc)

func (*Http2GinServer) Ready

func (h2gs *Http2GinServer) Ready() bool

func (*Http2GinServer) Run

func (h2gs *Http2GinServer) Run(ctx context.Context) error

func (*Http2GinServer) Use

func (hgs *Http2GinServer) Use(middleware ...gin.HandlerFunc)

type Option

type Option func(*Http2GinServer)

func WithHandlers

func WithHandlers(cols ...ginsvr.Handler) Option

func WithMaxHeaderBytes

func WithMaxHeaderBytes(maxHeaderBytes int) Option

func WithMiddleware

func WithMiddleware(mids ...gin.HandlerFunc) Option

func WithName

func WithName(name string) Option

func WithPort

func WithPort(port string) Option

func WithReadTimeout

func WithReadTimeout(readTimeout int) Option

func WithTLS

func WithTLS(cert, key string) Option

func WithValidator added in v1.2.2

func WithValidator(valid ...validaton.Validaton) Option

func WithWriteTimeout

func WithWriteTimeout(writeTimeout int) Option

Jump to

Keyboard shortcuts

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