Documentation ¶
Index ¶
- Constants
- type Body
- type Config
- type Option
- type Request
- func (m *Request) Body() []byte
- func (m *Request) Context() sctx.Context
- func (m *Request) GetHeader() map[string]string
- func (m *Request) GetMethod() string
- func (m *Request) GetName() string
- func (m *Request) GetRemoteAddr() string
- func (m *Request) GetService() string
- func (m *Request) Params() map[string]string
- func (m *Request) WithContext(ctx sctx.Context) alloter.IRequest
- type Response
- func (r *Response) Flush() error
- func (r *Response) Header() xtypes.SMap
- func (r *Response) Size() int
- func (r *Response) Status() int
- func (r *Response) Write(data []byte) (n int, err error)
- func (r *Response) WriteHeader(code int)
- func (r *Response) WriteString(s string) (n int, err error)
- func (r *Response) Written() bool
- type Server
- func (e *Server) Attempt() bool
- func (e *Server) Config(cfg config.Config)
- func (e *Server) Endpoint() *url.URL
- func (e *Server) Group(group string, middlewares ...middleware.Middleware) *server.RouterGroup
- func (e *Server) Handle(path string, obj interface{})
- 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) Stop(ctx context.Context) error
- func (e *Server) Type() string
- func (e *Server) Use(middlewares ...middleware.Middleware)
- type Setting
Constants ¶
View Source
const Type string = "rpc"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option 参数设置类型
func WithEndHook ¶ added in v0.1.1
func WithServiceName ¶ added in v0.1.1
WithServiceName 设置服务名称
func WithStartedHook ¶ added in v0.1.1
WithStartedHook 设置启动回调函数
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request 处理任务请求
func NewRequest ¶
NewRequest 构建任务请求
func (*Request) GetRemoteAddr ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Request 处理任务请求
func (*Response) WriteHeader ¶
func (*Response) WriteString ¶
Writes the string into the response body.
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) 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"` }
Click to show internal directories.
Click to hide internal directories.