Documentation
¶
Index ¶
- Variables
- func AllowAggregation(b bool) func(msg proto.Message) error
- func DataType(datat string) func(msg proto.Message) error
- func Delete(path string) func(msg proto.Message) error
- func Encoding(encoding string) func(msg proto.Message) error
- func Extension(ext *gnmi_ext.Extension) func(msg proto.Message) error
- func HeartbeatInterval(d time.Duration) func(msg proto.Message) error
- func NewCapabilitiesRequest(opts ...GNMIOption) (*gnmi.CapabilityRequest, error)
- func NewGetRequest(opts ...GNMIOption) (*gnmi.GetRequest, error)
- func NewSetRequest(opts ...GNMIOption) (*gnmi.SetRequest, error)
- func NewSubscribePollRequest(opts ...GNMIOption) *gnmi.SubscribeRequest
- func NewSubscribeRequest(opts ...GNMIOption) (*gnmi.SubscribeRequest, error)
- func NewTarget(opts ...TargetOption) (*target.Target, error)
- func Path(path string) func(msg proto.Message) error
- func Prefix(prefix string) func(msg proto.Message) error
- func Qos(qos uint32) func(msg proto.Message) error
- func Replace(opts ...GNMIOption) func(msg proto.Message) error
- func SampleInterval(d time.Duration) func(msg proto.Message) error
- func Subscription(opts ...GNMIOption) func(msg proto.Message) error
- func SubscriptionListMode(mode string) func(msg proto.Message) error
- func SubscriptionMode(mode string) func(msg proto.Message) error
- func SuppressRedundant(s bool) func(msg proto.Message) error
- func Target(target string) func(msg proto.Message) error
- func Update(opts ...GNMIOption) func(msg proto.Message) error
- func UpdatesOnly(b bool) func(msg proto.Message) error
- func UseAliases(b bool) func(msg proto.Message) error
- func Value(data interface{}, encoding string) func(msg proto.Message) error
- type GNMIOption
- type TargetOption
- func Address(addr string) TargetOption
- func Gzip(b bool) TargetOption
- func Insecure(i bool) TargetOption
- func LogTLSSecret(b 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 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 Token(token string) TargetOption
- func Username(username string) TargetOption
Constants ¶
This section is empty.
Variables ¶
var DefaultTargetTimeout = 10 * time.Second
var ErrInvalidMsgType = errors.New("invalid message type")
Functions ¶
func AllowAggregation ¶
AllowAggregation creates a GNMIOption that sets the AllowAggregation field in a *gnmi.SubscribeRequest with RequestType Subscribe.
func DataType ¶
DataType creates a GNMIOption that adds the data type to the supplied proto.Message which must be a *gnmi.GetRequest.
func Delete ¶
Delete creates a GNMIOption that creates a *gnmi.Path and adds it to the supplied proto.Message. the supplied message must be a *gnmi.SetRequest. The *gnmi.Path is added the .Delete list.
func Encoding ¶
Encoding creates a GNMIOption that adds the encoding type to the supplied proto.Message which can be a *gnmi.GetRequest, *gnmi.SetRequest or a *gnmi.SubscribeRequest with RequestType Subscribe.
func Extension ¶
Extention creates a GNMIOption that applies the suplied gnmi_ext.Extension to the provided proto.Message.
func HeartbeatInterval ¶
HeartbeatInterval creates a GNMIOption that sets the HeartbeatInterval in a proto.Message of type *gnmi.Subscription.
func NewCapabilitiesRequest ¶
func NewCapabilitiesRequest(opts ...GNMIOption) (*gnmi.CapabilityRequest, error)
NewCapabilitiesRequest creates a new *gnmi.CapabilityeRequest using the priovided GNMIOption list. returns an error in case one of the options is invalid
func NewGetRequest ¶
func NewGetRequest(opts ...GNMIOption) (*gnmi.GetRequest, error)
NewGetRequest creates a new *gnmi.GetRequest using the priovided GNMIOption list. returns an error in case one of the options is invalid
func NewSetRequest ¶
func NewSetRequest(opts ...GNMIOption) (*gnmi.SetRequest, error)
NewSetRequest creates a new *gnmi.SetRequest using the priovided GNMIOption list. returns an error in case one of the options is invalid
func NewSubscribePollRequest ¶
func NewSubscribePollRequest(opts ...GNMIOption) *gnmi.SubscribeRequest
NewSubscribePollRequest creates a new *gnmi.SubscribeRequest with request type Poll using the priovided GNMIOption list. returns an error in case one of the options is invalid
func NewSubscribeRequest ¶
func NewSubscribeRequest(opts ...GNMIOption) (*gnmi.SubscribeRequest, error)
NewSubscribeRequest creates a new *gnmi.SubscribeRequest using the priovided GNMIOption list. returns an error in case one of the options is invalid
func Path ¶
Path creates a GNMIOption that creates a *gnmi.Path and adds it to the supplied proto.Message which can be a *gnmi.GetRequest, *gnmi.SetRequest or a *gnmi.Subscription.
func Prefix ¶
Prefix creates a GNMIOption that creates a *gnmi.Path and adds it to the supplied proto.Message (as a Path Prefix) which can be a *gnmi.GetRequest, *gnmi.SetRequest or a *gnmi.SubscribeRequest with RequestType Subscribe.
func Qos ¶
Qos creates a GNMIOption that sets the QosMarking field in a *gnmi.SubscribeRequest with RequestType Subscribe.
func Replace ¶
func Replace(opts ...GNMIOption) func(msg proto.Message) error
Replace creates a GNMIOption that creates a *gnmi.Update message and adds it to the supplied proto.Message. the supplied message must be a *gnmi.SetRequest.
func SampleInterval ¶
SampleInterval creates a GNMIOption that sets the SampleInterval in a proto.Message of type *gnmi.Subscription.
func Subscription ¶
func Subscription(opts ...GNMIOption) func(msg proto.Message) error
UpdatesOnly creates a GNMIOption that creates a *gnmi.Subscription based on the supplied GNMIOption(s) and adds it the supplied proto.Mesage which must be of type *gnmi.SubscribeRequest with RequestType Subscribe.
func SubscriptionListMode ¶
SubscriptionListMode creates a GNMIOption that sets the SubscribeRequest Mode. The variable mode must be one of "once", "poll" or "stream". The supplied proto.Message must be a *gnmi.SubscribeRequest with RequestType Subscribe.
func SubscriptionMode ¶
SubscriptionMode creates a GNMIOption that sets the Subscription mode in a proto.Message of type *gnmi.Subscription.
func SuppressRedundant ¶
SuppressRedundant creates a GNMIOption that sets the SuppressRedundant in a proto.Message of type *gnmi.Subscription.
func Target ¶
Target creates a GNMIOption that set the gnmi Prefix target to the supplied string value. The proto.Message can be a *gnmi.GetRequest, *gnmi.SetRequest or a *gnmi.SubscribeRequest with RequestType Subscribe.
func Update ¶
func Update(opts ...GNMIOption) func(msg proto.Message) error
Update creates a GNMIOption that creates a *gnmi.Update message and adds it to the supplied proto.Message, the supplied message must be a *gnmi.SetRequest.
func UpdatesOnly ¶
UpdatesOnly creates a GNMIOption that sets the UpdatesOnly field in a *gnmi.SubscribeRequest with RequestType Subscribe.
func UseAliases ¶
UseAliases creates a GNMIOption that sets the UsesAliases field in a *gnmi.SubscribeRequest with RequestType Subscribe.
Types ¶
type GNMIOption ¶
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 LogTLSSecret ¶
func LogTLSSecret(b bool) TargetOption
LogTLSSecret, if set to true, enables logging of the TLS master key.
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 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 Token ¶
func Token(token string) TargetOption
Token sets the per RPC credentials for all RPC calls.