types

package
v1.16.0-pre.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	peerpb.PeerClient
	io.Closer
}

Client defines an interface that Peer service client should implement.

type ClientBuilder

type ClientBuilder interface {
	// Client builds a new Client that connects to the given target.
	Client(target string) (Client, error)
}

ClientBuilder creates a new Client.

type LocalClientBuilder

type LocalClientBuilder struct {
	DialTimeout time.Duration
}

LocalClientBuilder is a ClientBuilder that is suitable when the gRPC connection to the Peer service is local (typically a Unix Domain Socket).

func (LocalClientBuilder) Client

func (b LocalClientBuilder) Client(target string) (Client, error)

Client implements ClientBuilder.Client.

type Peer

type Peer struct {
	// Name is the name of the peer, typically the hostname. The name includes
	// the cluster name if a value other than default has been specified.
	// This value can be used to uniquely identify the host.
	// When the cluster name is not the default, the cluster name is prepended
	// to the peer name and a forward slash is added.
	//
	// Examples:
	//  - runtime1
	//  - testcluster/runtime1
	Name string

	// Address is the address of the peer's gRPC service.
	Address net.Addr

	// TLSEnabled indicates whether the service offered by the peer has TLS
	// enabled.
	TLSEnabled bool

	// TLSServerName is the name the TLS certificate should be matched to.
	TLSServerName string
}

Peer represents a hubble peer.

func FromChangeNotification

func FromChangeNotification(cn *peerpb.ChangeNotification) *Peer

FromChangeNotification creates a new Peer from a ChangeNotification.

func (Peer) Equal added in v1.15.0

func (p Peer) Equal(o Peer) bool

Equal reports whether the Peer is equal to the provided Peer

func (Peer) String

func (p Peer) String() string

String implements fmt's Stringer interface.

type RemoteClientBuilder

type RemoteClientBuilder struct {
	DialTimeout   time.Duration
	TLSConfig     certloader.ClientConfigBuilder
	TLSServerName string
}

RemoteClientBuilder is a ClientBuilder that is suitable when the gRPC connection to the Peer service is remote (typically a K8s Service).

func (RemoteClientBuilder) Client

func (b RemoteClientBuilder) Client(target string) (Client, error)

Client implements ClientBuilder.Client.

Jump to

Keyboard shortcuts

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