Documentation
¶
Index ¶
- Variables
- func Apply(m proto.Message, opts ...GNSIOption) error
- type GNSIOption
- type Target
- func (t *Target) AppendMetadata(ctx context.Context) context.Context
- func (t *Target) Close() error
- func (t *Target) Conn() grpc.ClientConnInterface
- func (t *Target) CreateGrpcClient(ctx context.Context, opts ...grpc.DialOption) error
- func (t *Target) NewAuthzClient() authz.AuthzClient
- func (t *Target) NewCertzClient() certz.CertzClient
- func (t *Target) NewCredentialzClient() credentialz.CredentialzClient
- func (t *Target) NewPathzClient() pathz.PathzClient
- type TargetOption
- func Address(addr string) TargetOption
- func Gzip(b bool) TargetOption
- func Insecure(i bool) TargetOption
- func Name(name string) TargetOption
- func Password(password string) TargetOption
- func SkipVerify(i bool) TargetOption
- func TLSCA(tlsca string) TargetOption
- func TLSCert(cert string) TargetOption
- func TLSConfig(tlsConfig *tls.Config) TargetOption
- func TLSKey(key string) TargetOption
- func TLSMaxVersion(v string) TargetOption
- func TLSMinVersion(v string) TargetOption
- func TLSVersion(v string) TargetOption
- func Timeout(timeout time.Duration) TargetOption
- func Username(username string) TargetOption
Constants ¶
This section is empty.
Variables ¶
var DefaultTargetTimeout = 10 * time.Second
var ErrInvalidMsgType = errors.New("invalid message type")
ErrInvalidMsgType is returned by a GNSIOption in case the Option is supplied an unexpected proto.Message
var ErrInvalidValue = errors.New("invalid value")
ErrInvalidValue is returned by a GNSIOption in case the Option is supplied an unexpected value.
Functions ¶
Types ¶
type GNSIOption ¶
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 (*Target) Conn ¶
func (t *Target) Conn() grpc.ClientConnInterface
func (*Target) CreateGrpcClient ¶
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 ¶
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 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 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.