Documentation ¶
Index ¶
- type Config
- type Option
- func Log(opts ...log.ServerOption) Option
- func WithAddr(addr string) Option
- func WithConfig(config config.Config) Option
- func WithDecodeRequestFunc(decReq engine.DecodeRequestFunc) Option
- func WithEncodeErrorFunc(encErr engine.EncodeErrorFunc) Option
- func WithEncodeResponseFunc(encResp engine.EncodeResponseFunc) Option
- func WithEndHook(f engine.Hook) Option
- func WithEngine(engine string) Option
- func WithMaxHeaderBytes(maxHeaderBytes uint) Option
- func WithReadHeaderTimeout(readHeaderTimeout uint) Option
- func WithReadTimeout(readTimeout uint) Option
- func WithServiceName(serviceName string) Option
- func WithStartedHook(f engine.Hook) Option
- func WithWriteTimeout(writeTimeout uint) Option
- type Server
- func (e *Server) Attempt() bool
- func (e *Server) Config(cfg config.Config)
- func (s *Server) Endpoint() *url.URL
- func (e *Server) Group(group string, middlewares ...middleware.Middleware) *engine.RouterGroup
- func (e *Server) Handle(path string, obj interface{}, opts ...engine.RouterOption)
- func (e *Server) Name() string
- func (e *Server) Options(opts ...Option)
- func (s *Server) RouterPathList() []string
- func (s *Server) ServiceName() string
- func (e *Server) Start(ctx context.Context) (err error)
- func (e *Server) Static(path, root string)
- func (e *Server) StaticFile(path, filepath string)
- func (e *Server) Stop(ctx context.Context) error
- func (e *Server) Type() string
- func (e *Server) Use(middlewares ...middleware.Middleware)
- type Static
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option 参数设置类型
func WithDecodeRequestFunc ¶ added in v0.5.1
func WithDecodeRequestFunc(decReq engine.DecodeRequestFunc) Option
WithDecodeRequestFunc 解析入参
func WithEncodeErrorFunc ¶ added in v0.5.1
func WithEncodeErrorFunc(encErr engine.EncodeErrorFunc) Option
WithEncodeErrorFunc 编码错误
func WithEncodeResponseFunc ¶ added in v0.5.1
func WithEncodeResponseFunc(encResp engine.EncodeResponseFunc) Option
WithEncodeResponseFunc 编码响应
func WithEndHook ¶
func WithMaxHeaderBytes ¶ added in v0.5.2
WithMaxHeaderBytes 最大头部大小(http.DefaultMaxHeaderBytes untyped int = 1 << 20 )
func WithReadHeaderTimeout ¶ added in v0.5.2
ReadHeaderTimeout 写入超时时间
func WithReadTimeout ¶ added in v0.5.2
WithReadTimeout 读取超时时间
func WithServiceName ¶ added in v0.1.1
WithServiceName 设置服务名称
func WithWriteTimeout ¶ added in v0.5.2
WithWriteTimeout 写入超时时间
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Group ¶
func (e *Server) Group(group string, middlewares ...middleware.Middleware) *engine.RouterGroup
func (*Server) Handle ¶
func (e *Server) Handle(path string, obj interface{}, opts ...engine.RouterOption)
func (*Server) RouterPathList ¶ added in v0.5.11
获取树形的路径列表
func (*Server) StaticFile ¶
func (*Server) Use ¶
func (e *Server) Use(middlewares ...middleware.Middleware)
Click to show internal directories.
Click to hide internal directories.