Documentation ¶
Overview ¶
Package bufapiclient switches between grpc and twirp on the client-side.
Index ¶
- func NewGRPCClientConnProvider(ctx context.Context, logger *zap.Logger, tlsConfig *tls.Config) (grpcclient.ClientConnProvider, error)
- func NewHTTPClient(tlsConfig *tls.Config) (httpclient.Client, error)
- func NewRegistryProvider(ctx context.Context, logger *zap.Logger, tlsConfig *tls.Config, ...) (registryv1alpha1apiclient.Provider, error)
- type RegistryProviderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGRPCClientConnProvider ¶
func NewGRPCClientConnProvider( ctx context.Context, logger *zap.Logger, tlsConfig *tls.Config, ) (grpcclient.ClientConnProvider, error)
NewGRPCClientConnProvider returns a new gRPC ClientConnProvider.
TODO: move this to another location.
func NewHTTPClient ¶
func NewHTTPClient( tlsConfig *tls.Config, ) (httpclient.Client, error)
NewHTTPClient returns a new HTTP Client.
TODO: move this to another location.
func NewRegistryProvider ¶
func NewRegistryProvider( ctx context.Context, logger *zap.Logger, tlsConfig *tls.Config, options ...RegistryProviderOption, ) (registryv1alpha1apiclient.Provider, error)
NewRegistryProvider creates a new registryv1alpha1apiclient.Provider for either grpc or twirp.
If tlsConfig is nil, no TLS is used.
Types ¶
type RegistryProviderOption ¶
type RegistryProviderOption func(*registryProviderOptions)
RegistryProviderOption is an option for a new registry Provider.
func RegistryProviderWithAddressMapper ¶
func RegistryProviderWithAddressMapper(addressMapper func(string) string) RegistryProviderOption
RegistryProviderWithAddressMapper returns a new RegistryProviderOption that maps addresses with the given function.
func RegistryProviderWithContextModifierProvider ¶
func RegistryProviderWithContextModifierProvider(contextModifierProvider func(address string) (func(context.Context) context.Context, error)) RegistryProviderOption
RegistryProviderWithContextModifierProvider returns a new RegistryProviderOption that creates a context modifier for a given address. This is used to modify the context before every RPC invocation.
func RegistryProviderWithGRPC ¶
func RegistryProviderWithGRPC() RegistryProviderOption
RegistryProviderWithGRPC returns a new RegistryProviderOption that turns on gRPC.