client

package
v2.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTLSNotConfigured = errors.New("tls config is not yet set")

Functions

This section is empty.

Types

type Conn

type Conn interface {
	grpc.ClientConnInterface
	io.Closer
	GetState() connectivity.State
}

func New

func New(serverURL string, tlsCfg *TLSConfig) (Conn, error)

type Pool

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

Pool keeps the list of clients to inter-cp servers. Because the list of inter-cp servers changes in runtime, we need to properly manage the connections to them (initialize, share, close etc.) Pool helps us to not reimplement this for every inter-cp service (catalog, envoyadmin, etc.)

func NewPool

func NewPool(
	newConn func(string, *TLSConfig) (Conn, error),
	idleDeadline time.Duration,
	now func() time.Time,
) *Pool

func (*Pool) Client

func (c *Pool) Client(serverURL string) (Conn, error)

func (*Pool) SetTLSConfig

func (c *Pool) SetTLSConfig(tlsCfg *TLSConfig)

SetTLSConfig can configure TLS in runtime. Because CA of the inter-cp server is managed by the CP in the runtime we cannot configure it when we create the pool.

func (*Pool) StartCleanup

func (c *Pool) StartCleanup(ctx context.Context, ticker *time.Ticker)

type TLSConfig

type TLSConfig struct {
	CaCert     x509.Certificate
	ClientCert tls.Certificate
}

Jump to

Keyboard shortcuts

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