smartclient

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

type InsecureCreds

type InsecureCreds map[string]string

func (InsecureCreds) GetRequestMetadata

func (c InsecureCreds) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (InsecureCreds) RequireTransportSecurity

func (c InsecureCreds) RequireTransportSecurity() bool

type SmartClient

type SmartClient struct {
	// contains filtered or unexported fields
}

SmartClient 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 NewSmartClient

func NewSmartClient(
	resolverConfig *EndpointResolverConfig,
	endpointConfig *EndpointConfig,
	fallback *FallbackEndpointConfig,
) (*SmartClient, error)

NewSmartClient creates an instance of the smart client with the specified configuration.

func (*SmartClient) Check

func (sc *SmartClient) Check(ctx context.Context, req *v0.CheckRequest, opts ...grpc.CallOption) (*v0.CheckResponse, error)

func (*SmartClient) ContentChangeCheck

func (sc *SmartClient) ContentChangeCheck(ctx context.Context, req *v0.ContentChangeCheckRequest, opts ...grpc.CallOption) (*v0.CheckResponse, error)

func (*SmartClient) Expand

func (sc *SmartClient) Expand(ctx context.Context, req *v0.ExpandRequest, opts ...grpc.CallOption) (*v0.ExpandResponse, error)

func (*SmartClient) Lookup

func (sc *SmartClient) Lookup(ctx context.Context, req *v0.LookupRequest, opts ...grpc.CallOption) (*v0.LookupResponse, error)

func (*SmartClient) Read

func (sc *SmartClient) Read(ctx context.Context, req *v0.ReadRequest, opts ...grpc.CallOption) (*v0.ReadResponse, error)

func (*SmartClient) ReadConfig

func (sc *SmartClient) ReadConfig(ctx context.Context, req *v0.ReadConfigRequest, opts ...grpc.CallOption) (*v0.ReadConfigResponse, error)

func (*SmartClient) ReadSchema

func (*SmartClient) Stop

func (sc *SmartClient) Stop()

Stop will cancel the client watch and clean up the pool

func (*SmartClient) Write

func (sc *SmartClient) Write(ctx context.Context, req *v0.WriteRequest, opts ...grpc.CallOption) (*v0.WriteResponse, error)

func (*SmartClient) WriteConfig

func (sc *SmartClient) WriteConfig(ctx context.Context, req *v0.WriteConfigRequest, opts ...grpc.CallOption) (*v0.WriteConfigResponse, error)

func (*SmartClient) WriteSchema

Jump to

Keyboard shortcuts

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