httpsvr

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Http2WithGin

func Http2WithGin(opts ...Http2Option) register.RegisterOption

func HttpWithGin

func HttpWithGin(opts ...HttpOption) register.RegisterOption

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"`

	Https bool   `toml:"https" json:"https"`
	Cert  string `toml:"cert" json:"cert"`
	Key   string `toml:"key" json:"key"`
	// contains filtered or unexported fields
}

func (*Http2GinServer) Check

func (h *Http2GinServer) Check() bool

TODO: 校验必要组件是否初始化

func (*Http2GinServer) Do added in v0.9.0

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

func (*Http2GinServer) Engine

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

func (*Http2GinServer) Name

func (h *Http2GinServer) Name() string

func (*Http2GinServer) Ready

func (h *Http2GinServer) Ready()

func (*Http2GinServer) SetName

func (h *Http2GinServer) SetName(name string)

func (*Http2GinServer) Start

func (h *Http2GinServer) Start(ctx context.Context) error

type Http2Option

type Http2Option func(*Http2GinServer)

func SetHttp2Name

func SetHttp2Name(name string) Http2Option

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"`

	Https bool   `toml:"https" json:"https"`
	Cert  string `toml:"cert" json:"cert"`
	Key   string `toml:"key" json:"key"`
	// contains filtered or unexported fields
}

func (*HttpGinServer) Check

func (h *HttpGinServer) Check() bool

TODO: 校验必要组件是否初始化

func (*HttpGinServer) Do added in v0.9.0

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

func (*HttpGinServer) Engine

func (h *HttpGinServer) Engine() *gin.Engine

func (*HttpGinServer) Name

func (h *HttpGinServer) Name() string

func (*HttpGinServer) Ready

func (h *HttpGinServer) Ready()

func (*HttpGinServer) SetName

func (h *HttpGinServer) SetName(name string)

func (*HttpGinServer) Start

func (h *HttpGinServer) Start(ctx context.Context) error

type HttpOption

type HttpOption func(*HttpGinServer)

func SetHttpName

func SetHttpName(name string) HttpOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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