Documentation ¶
Index ¶
- type Config
- type 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) *server.RouterGroup
- func (e *Server) Handle(path string, obj interface{}, methods ...server.Method)
- func (e *Server) Name() string
- func (e *Server) Options(opts ...Option)
- func (s *Server) ServiceName() string
- func (e *Server) Start(ctx context.Context) 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 Setting
- 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 WithEndHook ¶
func WithServiceName ¶ added in v0.1.1
WithServiceName 设置服务名称
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Group ¶
func (e *Server) Group(group string, middlewares ...middleware.Middleware) *server.RouterGroup
func (*Server) StaticFile ¶
func (*Server) Use ¶
func (e *Server) Use(middlewares ...middleware.Middleware)
type Setting ¶
type Setting struct { Config Config `json:"config" yaml:"config"` Middlewares []middleware.Config `json:"middlewares" yaml:"middlewares"` Header server.Header `json:"header" yaml:"header"` }
```
"api":{ "config":{"addr":":8080","status":"start/stop","read_timeout":10,"write_timeout":10,"read_header_timeout":10,"max_header_bytes":65525}, "middlewares":[ { "auth":{ "proto":"jwt", "jwt":{}, "exclude":["/**"] } },{}], "header":{}, }
```
Click to show internal directories.
Click to hide internal directories.