connectclient

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make[T any](cfg *Config, address string, factory StubFactory[T]) T

Make uses the given generated factory function to create a new connect client.

Types

type Config

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

Config holds configuration for creating Connect RPC clients.

func NewConfig

func NewConfig(httpClient connect.HTTPClient, options ...ConfigOption) *Config

NewConfig creates a new client configuration with the given HTTP client and options.

type ConfigOption

type ConfigOption func(*Config)

ConfigOption is an option for customizing a new Config.

func WithAddressMapper

func WithAddressMapper(addressMapper func(string) string) ConfigOption

WithAddressMapper maps the address with the given function.

func WithAuthInterceptorProvider

func WithAuthInterceptorProvider(authInterceptorProvider func(string) connect.UnaryInterceptorFunc) ConfigOption

WithAuthInterceptorProvider configures a provider that, when invoked, returns an interceptor that can be added to a client for setting the auth token

func WithInterceptors

func WithInterceptors(interceptors []connect.Interceptor) ConfigOption

WithInterceptors adds the slice of interceptors to all clients returned from this provider.

type StubFactory

type StubFactory[T any] func(connect.HTTPClient, string, ...connect.ClientOption) T

StubFactory is the type of a generated factory function, for creating Connect client stubs.

Jump to

Keyboard shortcuts

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