client

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package client defines the Options of client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigLocks

type ConfigLocks struct {
	Bits int
	Tags map[string]struct{}
}

ConfigLocks records changing made by options that are not allowed further modifications.

func NewConfigLocks

func NewConfigLocks() *ConfigLocks

NewConfigLocks creates a ConfigLocks.

func (*ConfigLocks) ApplyLocks

func (cl *ConfigLocks) ApplyLocks(cfg rpcinfo.RPCConfig, svr remoteinfo.RemoteInfo)

ApplyLocks applies the locking operations on rpcinfo.RPCConfig and internal.RemoteInfo.

func (*ConfigLocks) Merge

func (cl *ConfigLocks) Merge(c2 *ConfigLocks)

Merge merges another ConfigLocks into the current one.

func (*ConfigLocks) Zero

func (cl *ConfigLocks) Zero()

Zero ConfigLocks clear

type Option

type Option struct {
	F func(o *Options, di *utils.Slice)
}

Option is the only way to config client.

type Options

type Options struct {
	Cli     *rpcinfo.EndpointBasicInfo
	Svr     *rpcinfo.EndpointBasicInfo
	Configs rpcinfo.RPCConfig
	Locks   *ConfigLocks
	Once    *configutil.OptionOnce

	MetaHandlers []remote.MetaHandler

	RemoteOpt        *remote.ClientOption
	Proxy            proxy.ForwardProxy
	Resolver         discovery.Resolver
	HTTPResolver     http.Resolver
	Balancer         loadbalance.Loadbalancer
	BalancerCacheOpt *lbcache.Options
	PoolCfg          *connpool2.IdleConfig
	ErrHandle        func(error) error
	Targets          string
	CBSuite          *circuitbreak.CBSuite
	Timeouts         rpcinfo.TimeoutProvider

	ACLRules []acl.RejectFunc

	MWBs  []endpoint.MiddlewareBuilder
	IMWBs []endpoint.MiddlewareBuilder

	Bus          event.Bus
	Events       event.Queue
	ExtraTimeout time.Duration

	// DebugInfo should only contains objects that are suitable for json serialization.
	DebugInfo    utils.Slice
	DebugService diagnosis.Service

	// Observability
	TracerCtl  *internal_stats.Controller
	StatsLevel *stats.Level

	// retry policy
	RetryPolicy    *retry.Policy
	RetryContainer *retry.Container

	CloseCallbacks []func() error

	// GRPC
	GRPCConnPoolSize uint32
	GRPCConnectOpts  *grpc.ConnectOptions
}

Options is used to initialize a client.

func NewOptions

func NewOptions(opts []Option) *Options

NewOptions creates a new option.

func (*Options) Apply

func (o *Options) Apply(opts []Option)

Apply applies all options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL