Documentation ¶
Index ¶
- type ConsistentBackendClient
- func (sc *ConsistentBackendClient) DispatchCheck(ctx context.Context, req *v1.DispatchCheckRequest, opts ...grpc.CallOption) (*v1.DispatchCheckResponse, error)
- func (sc *ConsistentBackendClient) DispatchExpand(ctx context.Context, req *v1.DispatchExpandRequest, opts ...grpc.CallOption) (*v1.DispatchExpandResponse, error)
- func (sc *ConsistentBackendClient) DispatchLookup(ctx context.Context, req *v1.DispatchLookupRequest, opts ...grpc.CallOption) (*v1.DispatchLookupResponse, error)
- func (cbc *ConsistentBackendClient) Start(ctx context.Context)
- type EndpointConfig
- type EndpointResolverConfig
- type FallbackEndpointConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentBackendClient ¶
type ConsistentBackendClient struct {
// contains filtered or unexported fields
}
ConsistentBackendClient is a client which utilizes a dynamic source of backends and a consistent hashring implementation for consistently calling the same backend for the same request.
func NewConsistentBackendClient ¶
func NewConsistentBackendClient( resolverConfig *EndpointResolverConfig, endpointConfig *EndpointConfig, fallback *FallbackEndpointConfig, ) (*ConsistentBackendClient, error)
NewConsistentBackendClient creates an instance of the smart client with the specified configuration.
func (*ConsistentBackendClient) DispatchCheck ¶
func (sc *ConsistentBackendClient) DispatchCheck(ctx context.Context, req *v1.DispatchCheckRequest, opts ...grpc.CallOption) (*v1.DispatchCheckResponse, error)
func (*ConsistentBackendClient) DispatchExpand ¶
func (sc *ConsistentBackendClient) DispatchExpand(ctx context.Context, req *v1.DispatchExpandRequest, opts ...grpc.CallOption) (*v1.DispatchExpandResponse, error)
func (*ConsistentBackendClient) DispatchLookup ¶
func (sc *ConsistentBackendClient) DispatchLookup(ctx context.Context, req *v1.DispatchLookupRequest, opts ...grpc.CallOption) (*v1.DispatchLookupResponse, error)
func (*ConsistentBackendClient) Start ¶
func (cbc *ConsistentBackendClient) Start(ctx context.Context)
Start starts the process which will dynamically update backend membership continually. Stop this service by canceling the context.
type EndpointConfig ¶
type EndpointConfig struct {
// contains filtered or unexported fields
}
EndpointConfig contains configuration for establishing connections with a specific backend service.
func NewEndpointConfig ¶
func NewEndpointConfig(serviceName, dnsName, token, caCertPath string) *EndpointConfig
NewEndpointConfig configures TLS protected backend connections.
func NewEndpointConfigNoTLS ¶
func NewEndpointConfigNoTLS(serviceName, dnsName, token string) *EndpointConfig
NewEndpointConfigNoTLS configures plaintext backend connections.
type EndpointResolverConfig ¶
type EndpointResolverConfig struct {
// contains filtered or unexported fields
}
EndpointResolverConfig contains configuration for establishing a connection to a dynamic endpoint resolver service.
func NewEndpointResolver ¶
func NewEndpointResolver(resolverEndpoint, caCertPath string) *EndpointResolverConfig
NewEndpointResolver configures a TLS protected endpoint resolver connection.
func NewEndpointResolverNoTLS ¶
func NewEndpointResolverNoTLS(resolverEndpoint string) *EndpointResolverConfig
NewEndpointResolverNoTLS configures a plaintext endpoint resolver connection.
type FallbackEndpointConfig ¶
type FallbackEndpointConfig struct {
// contains filtered or unexported fields
}
FallbackEndpointConfig contains configuration for a static fallback endpoint to be used when no resolved endpoints are available.
func NewFallbackEndpoint ¶
func NewFallbackEndpoint(endpoint, token, caCertPath string) *FallbackEndpointConfig
NewFallbackEndpoint configures a TLS protected fallback endpoint connection.
func NewFallbackEndpointNoTLS ¶
func NewFallbackEndpointNoTLS(endpoint, token string) *FallbackEndpointConfig
NewFallbackEndpointNoTLS configures a plaintext fallback endpoint connection.
func NoFallbackEndpoint ¶
func NoFallbackEndpoint() *FallbackEndpointConfig
NoFallbackEndpoint disables the fallback backend option.