Documentation
¶
Index ¶
- Variables
- type FilterFunc
- type Method
- type Option
- func WithAddress(addr string) Option
- func WithAfterHandle(iter ...interceptor.ServerHandler) Option
- func WithBeforeHandle(iter ...interceptor.ServerHandler) Option
- func WithCodecType(codecType string) Option
- func WithKeepAlivePeriod(t time.Duration) Option
- func WithNetWork(network string) Option
- func WithPluginFactory(p *plugin.Factory) Option
- func WithPluginFactoryOptions(o []plugin.Option) Option
- func WithPort(port string) Option
- func WithSerializerType(serializerType string) Option
- func WithServerName(name string) Option
- type Options
- type Server
- type Service
- type ServiceDesc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDispatcher = NewDispatcher()
View Source
var NewDispatcher = func() *dispatcher { return &dispatcher{ serviceMap: make(map[string]Service), } }
Functions ¶
This section is empty.
Types ¶
type FilterFunc ¶
type FilterFunc func(ctx context.Context, srv interface{}, parse func(interface{}) error, handlers []interceptor.ServerHandler) (rep interface{}, err error)
type Method ¶
type Method struct {
Name string
Func FilterFunc
}
type Option ¶
type Option func(*Options)
func WithAddress ¶
func WithAfterHandle ¶
func WithAfterHandle(iter ...interceptor.ServerHandler) Option
func WithBeforeHandle ¶
func WithBeforeHandle(iter ...interceptor.ServerHandler) Option
func WithCodecType ¶
func WithKeepAlivePeriod ¶
func WithNetWork ¶
func WithPluginFactory ¶
func WithSerializerType ¶
func WithServerName ¶
type Options ¶
type Options struct {
ServerName string `yaml:"name"`
Port string `yaml:"port"`
Network string `yaml:"network"`
KeepAlivePeriod time.Duration `yaml:"keep_alive_period"`
SerializerType string `yaml:"serializer"`
CodecType string `yaml:"codec"`
CompressType string `yaml:"compress"`
Address string
PluginFactoryOptions []plugin.Option
PluginFactory *plugin.Factory
// contains filtered or unexported fields
}
type Server ¶
func (*Server) Register ¶
func (s *Server) Register(srvDesc *ServiceDesc, srv interface{}, opts ...Option)
func (*Server) RegisterService ¶
type Service ¶
type Service interface {
Register(string, FilterFunc)
Serve(o *Options) error
Close()
// contains filtered or unexported methods
}
type ServiceDesc ¶
Click to show internal directories.
Click to hide internal directories.