api

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTargetTimeout = 10 * time.Second
View Source
var ErrInvalidMsgType = errors.New("invalid message type")

ErrInvalidMsgType is returned by a GNSIOption in case the Option is supplied an unexpected proto.Message

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue is returned by a GNSIOption in case the Option is supplied an unexpected value.

Functions

func Apply

func Apply(m proto.Message, opts ...GNSIOption) error

Apply is a helper function that simply applies the options to the proto.Message. It returns an error if any of the options fails.

Types

type GNSIOption

type GNSIOption func(proto.Message) error

type Target

type Target struct {
	Config *config.TargetConfig
	// contains filtered or unexported fields
}

func NewTarget

func NewTarget(opts ...TargetOption) (*Target, error)

func NewTargetFromConfig

func NewTargetFromConfig(tc *config.TargetConfig) *Target

func (*Target) AppendMetadata

func (t *Target) AppendMetadata(ctx context.Context) context.Context

func (*Target) Close

func (t *Target) Close() error

func (*Target) Conn

func (t *Target) Conn() grpc.ClientConnInterface

func (*Target) CreateGrpcClient

func (t *Target) CreateGrpcClient(ctx context.Context, opts ...grpc.DialOption) error

func (*Target) NewAuthzClient

func (t *Target) NewAuthzClient() authz.AuthzClient

func (*Target) NewCertzClient

func (t *Target) NewCertzClient() certz.CertzClient

func (*Target) NewCredentialzClient

func (t *Target) NewCredentialzClient() credentialz.CredentialzClient

func (*Target) NewPathzClient

func (t *Target) NewPathzClient() pathz.PathzClient

type TargetOption

type TargetOption func(*Target) error

func Address

func Address(addr string) TargetOption

Address sets the target address. This Option can be set multiple times.

func Gzip

func Gzip(b bool) TargetOption

Gzip, if set to true, adds gzip compression to the gRPC connection.

func Insecure

func Insecure(i bool) TargetOption

Insecure sets the option to create a gNMI client with an insecure gRPC connection

func Name

func Name(name string) TargetOption

Name sets the target name.

func Password

func Password(password string) TargetOption

Password sets the target Password.

func SkipVerify

func SkipVerify(i bool) TargetOption

SkipVerify sets the option to create a gNMI client with a secure gRPC connection without verifying the target's certificates.

func TLSCA

func TLSCA(tlsca string) TargetOption

TLSCA sets that path towards the TLS certificate authority file.

func TLSCert

func TLSCert(cert string) TargetOption

TLSCert sets that path towards the TLS certificate file.

func TLSConfig added in v0.0.2

func TLSConfig(tlsConfig *tls.Config) TargetOption

func TLSKey

func TLSKey(key string) TargetOption

TLSKey sets that path towards the TLS key file.

func TLSMaxVersion

func TLSMaxVersion(v string) TargetOption

TLSMaxVersion sets the TLS maximum version used during the TLS handshake.

func TLSMinVersion

func TLSMinVersion(v string) TargetOption

TLSMinVersion sets the TLS minimum version used during the TLS handshake.

func TLSVersion

func TLSVersion(v string) TargetOption

TLSVersion sets the desired TLS version used during the TLS handshake.

func Timeout

func Timeout(timeout time.Duration) TargetOption

Timeout sets the gNMI client creation timeout.

func Username

func Username(username string) TargetOption

Username sets the target Username.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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