Documentation
¶
Overview ¶
Package server defines the Options of server
Package server defines the Options about remote transport of client.
Index ¶
- func ApplyOptions(opts []Option, o *Options)
- func ApplyRegisterOptions(opts []RegisterOption, o *RegisterOptions)
- func DefaultSysExitSignal() <-chan error
- func SysExitSignal() chan os.Signal
- type Config
- type Limit
- type Option
- type Options
- type RegisterOption
- type RegisterOptions
- type StreamOption
- type StreamOptions
- type UnaryOption
- type UnaryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOptions ¶
ApplyOptions applies the given options.
func ApplyRegisterOptions ¶ added in v0.9.0
func ApplyRegisterOptions(opts []RegisterOption, o *RegisterOptions)
ApplyRegisterOptions applies the given register options.
func DefaultSysExitSignal ¶ added in v0.1.0
func DefaultSysExitSignal() <-chan error
func SysExitSignal ¶ added in v0.1.0
Types ¶
type Config ¶
type Config struct {
Address net.Addr
// Duration that server waits for to allow any existing connection to be closed gracefully.
ExitWaitTime time.Duration
// Duration that server waits for after error occurs during connection accepting.
AcceptFailedDelayTime time.Duration
// Duration that the accepted connection waits for to read or write data, only works under NIO.
MaxConnectionIdleTime time.Duration
}
Config contains some server-side configuration.
type Limit ¶ added in v0.3.2
type Limit struct {
Limits *limit.Option
LimitReporter limiter.LimitReporter
ConLimit limiter.ConcurrencyLimiter
QPSLimit limiter.RateLimiter
// QPSLimitPostDecode is true to indicate that the QPS limiter takes effect in
// the OnMessage callback, and false for the OnRead callback.
// Usually when the server is multiplexed, Kitex set it to True by default.
QPSLimitPostDecode bool
}
type Options ¶
type Options struct {
Svr *rpcinfo.EndpointBasicInfo
Configs rpcinfo.RPCConfig
LockBits int
Once *configutil.OptionOnce
UnaryOptions UnaryOptions
StreamOptions StreamOptions
MetaHandlers []remote.MetaHandler
RemoteOpt *remote.ServerOption
ErrHandle func(context.Context, error) error
ExitSignal func() <-chan error
Proxy proxy.ReverseProxy
// Registry is used for service registry.
Registry registry.Registry
// RegistryInfo is used to in registry.
RegistryInfo *registry.Info
ACLRules []acl.RejectFunc
Limit Limit
MWBs []endpoint.MiddlewareBuilder
Bus event.Bus
Events event.Queue
// DebugInfo should only contain objects that are suitable for json serialization.
DebugInfo utils.Slice
DebugService diagnosis.Service
// Observability
TracerCtl *rpcinfo.TraceController
StatsLevel *stats.Level
BackupOpt backup.Options
Streaming stream.StreamingConfig // deprecated, use StreamOptions instead
RefuseTrafficWithoutServiceName bool
EnableContextTimeout bool
}
Options is used to initialize the server.
type RegisterOption ¶ added in v0.9.0
type RegisterOption struct {
F func(o *RegisterOptions)
}
RegisterOption is the only way to config service registration.
func WithUnknownService ¶ added in v0.15.0
func WithUnknownService() RegisterOption
type RegisterOptions ¶ added in v0.9.0
RegisterOptions is used to config service registration.
func NewRegisterOptions ¶ added in v0.9.0
func NewRegisterOptions(opts []RegisterOption) *RegisterOptions
NewRegisterOptions creates a register options.
type StreamOption ¶ added in v0.13.0
type StreamOption struct {
F func(o *StreamOptions, di *utils.Slice)
}
type StreamOptions ¶ added in v0.13.0
type StreamOptions struct {
EventHandler streaming.EventHandler
StreamMiddlewares []sep.StreamMiddleware
StreamMiddlewareBuilders []sep.StreamMiddlewareBuilder
StreamRecvMiddlewares []sep.StreamRecvMiddleware
StreamRecvMiddlewareBuilders []sep.StreamRecvMiddlewareBuilder
StreamSendMiddlewares []sep.StreamSendMiddleware
StreamSendMiddlewareBuilders []sep.StreamSendMiddlewareBuilder
}
func (*StreamOptions) BuildRecvChain ¶ added in v0.13.0
func (o *StreamOptions) BuildRecvChain() sep.StreamRecvEndpoint
func (*StreamOptions) BuildSendChain ¶ added in v0.13.0
func (o *StreamOptions) BuildSendChain() sep.StreamSendEndpoint
func (*StreamOptions) InitMiddlewares ¶ added in v0.13.0
func (o *StreamOptions) InitMiddlewares(ctx context.Context)
type UnaryOption ¶ added in v0.13.0
type UnaryOption struct {
F func(o *UnaryOptions, di *utils.Slice)
}
type UnaryOptions ¶ added in v0.13.0
type UnaryOptions struct {
UnaryMiddlewares []endpoint.UnaryMiddleware
UnaryMiddlewareBuilders []endpoint.UnaryMiddlewareBuilder
}
func (*UnaryOptions) InitMiddlewares ¶ added in v0.13.0
func (o *UnaryOptions) InitMiddlewares(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.