Documentation ¶
Index ¶
- func GetClientOptions(ops []Option) []client.Option
- type Option
- func ConvertOptionFrom(opt client.Option) Optiondeprecated
- func WithACLRules(rules ...acl.RejectFunc) Option
- func WithClientBasicInfo(ebi *rpcinfo.EndpointBasicInfo) Option
- func WithCloseCallbacks(callback func() error) Option
- func WithConnReporterEnabled() Option
- func WithConnectTimeout(d time.Duration) Option
- func WithContextBackup(...) Option
- func WithDestService(svr string) Option
- func WithDiagnosisService(ds diagnosis.Service) Option
- func WithDialer(d remote.Dialer) Option
- func WithErrorHandler(f func(context.Context, error) error) Option
- func WithFirstMetaHandler(h remote.MetaHandler) Option
- func WithGRPCConnPoolSize(s uint32) Option
- func WithGRPCInitialConnWindowSize(s uint32) Option
- func WithGRPCInitialWindowSize(s uint32) Option
- func WithGRPCKeepaliveParams(kp grpc.ClientKeepalive) Option
- func WithGRPCMaxHeaderListSize(s uint32) Option
- func WithGRPCReadBufferSize(s uint32) Option
- func WithGRPCTLSConfig(tlsConfig *tls.Config) Option
- func WithGRPCWriteBufferSize(s uint32) Option
- func WithHTTPResolver(r http.Resolver) Option
- func WithHostPorts(hostPorts ...string) Option
- func WithInstanceMW(mw endpoint.Middleware) Option
- func WithLoadBalancer(lb loadbalance.Loadbalancer, opts ...*lbcache.Options) Option
- func WithMetaHandler(h remote.MetaHandler) Option
- func WithMiddleware(mw endpoint.Middleware) Option
- func WithMiddlewareBuilder(mwb endpoint.MiddlewareBuilder) Option
- func WithPayloadCodec(c remote.PayloadCodec) Option
- func WithProxy(p proxy.ForwardProxy) Option
- func WithRecvMiddleware(mw endpoint.RecvMiddleware) Option
- func WithRecvMiddlewareBuilder(mwb endpoint.RecvMiddlewareBuilder) Option
- func WithResolver(r discovery.Resolver) Option
- func WithSendMiddleware(mw endpoint.SendMiddleware) Option
- func WithSendMiddlewareBuilder(mwb endpoint.SendMiddlewareBuilder) Option
- func WithStatsLevel(level stats.Level) Option
- func WithSuite(suite client.Suite) Option
- func WithTag(key, val string) Option
- func WithTracer(c stats.Tracer) Option
- func WithWarmingUp(wuo *warmup.ClientOption) Option
- func WithXDSSuite(suite xds.ClientSuite) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientOptions ¶
GetClientOptions converts given streamclient.Option(s) to client.Option(s)
Types ¶
type Option ¶
func ConvertOptionFrom
deprecated
Deprecated: it's not supposed to be called by users directly; may be removed in future versions. ConvertOptionFrom converts client.Option to streamclient.Option It's convenient for creating StreamOption from existing client.Option Note: NOT all client.Option(s) converted will work for stream clients; Even if it works for now, it's NOT guaranteed that it will always work for future versions.
func WithACLRules ¶
func WithACLRules(rules ...acl.RejectFunc) Option
WithACLRules adds ACL rules. Note that the ACL checking process happens before service discovery.
func WithClientBasicInfo ¶
func WithClientBasicInfo(ebi *rpcinfo.EndpointBasicInfo) Option
WithClientBasicInfo provides initial information for client endpoint in RPCInfo.
func WithCloseCallbacks ¶
WithCloseCallbacks adds callback to Close
func WithConnReporterEnabled ¶
func WithConnReporterEnabled() Option
WithConnReporterEnabled to enable reporting connection pool stats.
func WithConnectTimeout ¶
WithConnectTimeout specifies the connection timeout.
func WithContextBackup ¶
func WithContextBackup(backupHandler func(prev, cur context.Context) (ctx context.Context, backup bool)) Option
WithContextBackup enables local-session to retrieve context backuped by server, in case of user don't correctly pass context into next RPC call.
- backupHandler pass a handler to check and handler user-defined key-values according to current context, returning backup==false means no need further operations.
func WithDestService ¶
WithDestService specifies the name of target service.
func WithDiagnosisService ¶
WithDiagnosisService sets the diagnosis service for gathering debug information.
func WithDialer ¶
WithDialer sets the Dialer for creating connections.
func WithErrorHandler ¶
WithErrorHandler sets the error handler.
func WithFirstMetaHandler ¶
func WithFirstMetaHandler(h remote.MetaHandler) Option
WithFirstMetaHandler adds a MetaHandler to the beginning of the current list.
func WithGRPCConnPoolSize ¶
WithGRPCConnPoolSize sets the value for the client connection pool size.
func WithGRPCInitialConnWindowSize ¶
WithGRPCInitialConnWindowSize sets the value for initial window size on a connection of grpc. The lower bound for window size is 64K and any value smaller than that will be ignored. It corresponds to the WithInitialConnWindowSize DialOption of gRPC.
func WithGRPCInitialWindowSize ¶
WithGRPCInitialWindowSize sets the value for initial window size on a grpc stream. The lower bound for window size is 64K and any value smaller than that will be ignored. It corresponds to the WithInitialWindowSize DialOption of gRPC.
func WithGRPCKeepaliveParams ¶
func WithGRPCKeepaliveParams(kp grpc.ClientKeepalive) Option
WithGRPCKeepaliveParams returns a DialOption that specifies keepalive parameters for the client transport. It corresponds to the WithKeepaliveParams DialOption of gRPC.
func WithGRPCMaxHeaderListSize ¶
WithGRPCMaxHeaderListSize returns a DialOption that specifies the maximum (uncompressed) size of header list that the client is prepared to accept. It corresponds to the WithMaxHeaderListSize DialOption of gRPC.
func WithGRPCReadBufferSize ¶
WithGRPCReadBufferSize lets you set the size of read buffer, this determines how much data can be read at most for each read syscall.
func WithGRPCTLSConfig ¶
WithGRPCTLSConfig sets the TLS config for gRPC client.
func WithGRPCWriteBufferSize ¶
WithGRPCWriteBufferSize determines how much data can be batched before writing on the wire. The corresponding memory allocation for this buffer will be twice the size to keep syscalls low. The default value for this buffer is 32KB.
func WithHTTPResolver ¶
WithHTTPResolver specifies resolver for url (which specified by WithURL).
func WithHostPorts ¶
WithHostPorts sets the host ports for a stream client.
func WithInstanceMW ¶
func WithInstanceMW(mw endpoint.Middleware) Option
WithInstanceMW adds middleware for client to handle request after service discovery and loadbalance process.
func WithLoadBalancer ¶
func WithLoadBalancer(lb loadbalance.Loadbalancer, opts ...*lbcache.Options) Option
WithLoadBalancer sets the loadbalancer for client.
func WithMetaHandler ¶
func WithMetaHandler(h remote.MetaHandler) Option
WithMetaHandler adds a MetaHandler to the end of the current list.
func WithMiddleware ¶
func WithMiddleware(mw endpoint.Middleware) Option
WithMiddleware adds middleware for client to handle request. NOTE: for streaming APIs (bidirectional, client, server), req is not valid, resp is *streaming.Result If you want to intercept recv/send calls, please use Recv/Send Middleware
func WithMiddlewareBuilder ¶
func WithMiddlewareBuilder(mwb endpoint.MiddlewareBuilder) Option
WithMiddlewareBuilder adds middleware that depend on a per-client context for client to handle request NOTE: for streaming APIs (bidirectional, client, server), req is not valid, resp is *streaming.Result If you want to intercept recv/send calls, please use Recv/Send MiddlewareBuilder
func WithPayloadCodec ¶
func WithPayloadCodec(c remote.PayloadCodec) Option
WithPayloadCodec to set a payloadCodec that handle other payload which not support by kitex
func WithProxy ¶
func WithProxy(p proxy.ForwardProxy) Option
WithProxy sets the forward Proxy for client.
func WithRecvMiddleware ¶
func WithRecvMiddleware(mw endpoint.RecvMiddleware) Option
WithRecvMiddleware adds middleware for client to handle response. It's used for intercepting stream.RecvMsg (called by Recv or CloseAndRecv) calls
func WithRecvMiddlewareBuilder ¶
func WithRecvMiddlewareBuilder(mwb endpoint.RecvMiddlewareBuilder) Option
WithRecvMiddlewareBuilder adds middleware that depend on a per-client context for client to handle response
func WithResolver ¶
WithResolver provides the Resolver for kitex client.
func WithSendMiddleware ¶
func WithSendMiddleware(mw endpoint.SendMiddleware) Option
WithSendMiddleware adds middleware for client to handle request. It's used for intercepting stream.SendMsg (called by Send or SendAndClose) calls
func WithSendMiddlewareBuilder ¶
func WithSendMiddlewareBuilder(mwb endpoint.SendMiddlewareBuilder) Option
WithSendMiddlewareBuilder adds middleware that depend on a per-client context for client to handle request
func WithStatsLevel ¶
WithStatsLevel sets the stats level for client.
func WithWarmingUp ¶
func WithWarmingUp(wuo *warmup.ClientOption) Option
WithWarmingUp forces the client to do some warm-ups at the end of the initialization.
func WithXDSSuite ¶
func WithXDSSuite(suite xds.ClientSuite) Option
WithXDSSuite is used to set the xds suite for the client.