Documentation ¶
Index ¶
- func InstallProxyOptionsWatchDog(dog func(cc *ProxyOptions))
- type Client
- type ClientProxy
- func (c *ClientProxy) AsyncCall(ctx context.Context, uri interface{}, rq interface{}, af process.RouterFunc, ...) (err error)
- func (c *ClientProxy) Call(ctx context.Context, uri interface{}, rq, rs interface{}, ...) (err error)
- func (c *ClientProxy) Close(ctx context.Context)
- func (c *ClientProxy) InitProxy(ctx context.Context) (err error)
- func (c *ClientProxy) Notify(ctx context.Context, uri interface{}, rq interface{}, opts *rpc.NoticeOptions) (err error)
- type LinkMode
- type NewClientFunc
- type NewDiscoveryFunc
- type ProxyOption
- func WithAsyncLink(v bool) ProxyOption
- func WithDiscoveryOptions(v ...discovery.DiscoveryOption) ProxyOption
- func WithFrameLogger(v *zaplog.Logger) ProxyOption
- func WithLinkInterval(v time.Duration) ProxyOption
- func WithLinkMode(v LinkMode) ProxyOption
- func WithNewClient(v NewClientFunc) ProxyOption
- func WithNewDiscovery(v NewDiscoveryFunc) ProxyOption
- func WithPickerBuilder(v balancer.PickerBuilder) ProxyOption
- func WithUpdateBalanceAfterLink(v bool) ProxyOption
- func WithUseAftreAllLink(v bool) ProxyOption
- type ProxyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallProxyOptionsWatchDog ¶
func InstallProxyOptionsWatchDog(dog func(cc *ProxyOptions))
InstallProxyOptionsWatchDog install watch dog
Types ¶
type ClientProxy ¶
type ClientProxy struct {
// contains filtered or unexported fields
}
ClientProxy client wrap
func NewClientProxy ¶
func NewClientProxy(path string, opt ...ProxyOption) (proxy *ClientProxy, err error)
func (*ClientProxy) AsyncCall ¶
func (c *ClientProxy) AsyncCall(ctx context.Context, uri interface{}, rq interface{}, af process.RouterFunc, opts *rpc.AsyncCallOptions) (err error)
func (*ClientProxy) Call ¶
func (c *ClientProxy) Call(ctx context.Context, uri interface{}, rq, rs interface{}, opts *rpc.CallOptions) (err error)
func (*ClientProxy) Close ¶
func (c *ClientProxy) Close(ctx context.Context)
func (*ClientProxy) Notify ¶
func (c *ClientProxy) Notify(ctx context.Context, uri interface{}, rq interface{}, opts *rpc.NoticeOptions) (err error)
type NewClientFunc ¶
type NewClientFunc func(netwrok, addr string, inner *process.InnerOptions) (cli Client, err error)
NewClientFunc new client func. inner use for custom client
type NewDiscoveryFunc ¶
type ProxyOption ¶
type ProxyOption func(cc *ProxyOptions) ProxyOption
ProxyOption option define
func WithDiscoveryOptions ¶
func WithDiscoveryOptions(v ...discovery.DiscoveryOption) ProxyOption
DiscoveryOptions custom discovery options
func WithNewClient ¶
func WithNewClient(v NewClientFunc) ProxyOption
NewEntry create custom entry for discovery new entry
func WithNewDiscovery ¶
func WithNewDiscovery(v NewDiscoveryFunc) ProxyOption
NewDiscovery create discovery
func WithPickerBuilder ¶
func WithPickerBuilder(v balancer.PickerBuilder) ProxyOption
BalancerName specify default balancer. empty means use server set value.
func WithUpdateBalanceAfterLink ¶
func WithUpdateBalanceAfterLink(v bool) ProxyOption
UpdateBalanceAfterLink Whether the link must have been established before notifying the balancer
func WithUseAftreAllLink ¶
func WithUseAftreAllLink(v bool) ProxyOption
UseAfterAllLink the first initialization must be fully linked before it can be used
type ProxyOptions ¶
type ProxyOptions struct { // NewEntry create custom entry for discovery new entry NewClient NewClientFunc // DiscoveryOptions custom discovery options DiscoveryOptions []discovery.DiscoveryOption // NewDiscovery create discovery NewDiscovery NewDiscoveryFunc // BalancerName specify default balancer. empty means use server set value. PickerBuilder balancer.PickerBuilder // AsyncLink client async link server AsyncLink bool // UpdateBalanceAfterLink Whether the link must have been established before notifying the balancer UpdateBalanceAfterLink bool // LinkMode immediately or delay link LinkMode LinkMode // UseAfterAllLink the first initialization must be fully linked before it can be used UseAftreAllLink bool // LinkInterval LinkInterval time.Duration // frame log FrameLogger *zaplog.Logger }
func NewProxyOptions ¶
func NewProxyOptions(opts ...ProxyOption) *ProxyOptions
NewProxyOptions create options instance.
func (*ProxyOptions) ApplyOption ¶
func (cc *ProxyOptions) ApplyOption(opts ...ProxyOption)
ApplyOption modify options
func (*ProxyOptions) GetSetOption ¶
func (cc *ProxyOptions) GetSetOption(opt ProxyOption) ProxyOption
GetSetOption modify and get last option
func (*ProxyOptions) SetOption ¶
func (cc *ProxyOptions) SetOption(opt ProxyOption)
SetOption modify options