Documentation ¶
Index ¶
- type SubscribeResponse
- type Target
- func (t *Target) Capabilities(ctx context.Context, ext ...*gnmi_ext.Extension) (*gnmi.CapabilityResponse, error)
- func (t *Target) Close() error
- func (t *Target) ConnState() string
- func (t *Target) CreateGNMIClient(ctx context.Context, opts ...grpc.DialOption) error
- func (t *Target) DecodeProtoBytes(resp *gnmi.SubscribeResponse) error
- func (t *Target) DeleteSubscription(name string)
- func (t *Target) Get(ctx context.Context, req *gnmi.GetRequest) (*gnmi.GetResponse, error)
- func (t *Target) NumberOfOnceSubscriptions() int
- func (t *Target) ReadSubscriptions() (chan *SubscribeResponse, chan *TargetError)
- func (t *Target) Set(ctx context.Context, req *gnmi.SetRequest) (*gnmi.SetResponse, error)
- func (t *Target) StopSubscription(name string)
- func (t *Target) StopSubscriptions()
- func (t *Target) Subscribe(ctx context.Context, req *gnmi.SubscribeRequest, subscriptionName string)
- func (t *Target) SubscribeOnce(ctx context.Context, req *gnmi.SubscribeRequest) ([]*gnmi.SubscribeResponse, error)
- func (t *Target) SubscribeOnceChan(ctx context.Context, req *gnmi.SubscribeRequest) (chan *gnmi.SubscribeResponse, chan error)
- type TargetError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubscribeResponse ¶
type SubscribeResponse struct { SubscriptionName string SubscriptionConfig *types.SubscriptionConfig Response *gnmi.SubscribeResponse }
SubscribeResponse //
type Target ¶
type Target struct { Config *types.TargetConfig `json:"config,omitempty"` Subscriptions map[string]*types.SubscriptionConfig `json:"subscriptions,omitempty"` Client gnmi.GNMIClient `json:"-"` SubscribeClients map[string]gnmi.GNMI_SubscribeClient `json:"-"` // subscription name to subscribeClient StopChan chan struct{} `json:"-"` Cfn context.CancelFunc `json:"-"` RootDesc desc.Descriptor `json:"-"` // contains filtered or unexported fields }
Target represents a gNMI enabled box
func (*Target) Capabilities ¶
func (t *Target) Capabilities(ctx context.Context, ext ...*gnmi_ext.Extension) (*gnmi.CapabilityResponse, error)
Capabilities sends a gnmi.CapabilitiesRequest to the target *t and returns a gnmi.CapabilitiesResponse and an error
func (*Target) CreateGNMIClient ¶
CreateGNMIClient //
func (*Target) DecodeProtoBytes ¶
func (t *Target) DecodeProtoBytes(resp *gnmi.SubscribeResponse) error
func (*Target) DeleteSubscription ¶
func (*Target) Get ¶
func (t *Target) Get(ctx context.Context, req *gnmi.GetRequest) (*gnmi.GetResponse, error)
Get sends a gnmi.GetRequest to the target *t and returns a gnmi.GetResponse and an error
func (*Target) NumberOfOnceSubscriptions ¶
func (*Target) ReadSubscriptions ¶
func (t *Target) ReadSubscriptions() (chan *SubscribeResponse, chan *TargetError)
func (*Target) Set ¶
func (t *Target) Set(ctx context.Context, req *gnmi.SetRequest) (*gnmi.SetResponse, error)
Set sends a gnmi.SetRequest to the target *t and returns a gnmi.SetResponse and an error
func (*Target) StopSubscription ¶ added in v0.22.0
func (*Target) StopSubscriptions ¶ added in v0.21.0
func (t *Target) StopSubscriptions()
func (*Target) Subscribe ¶
func (t *Target) Subscribe(ctx context.Context, req *gnmi.SubscribeRequest, subscriptionName string)
Subscribe sends a gnmi.SubscribeRequest to the target *t, responses and error are sent to the target channels
func (*Target) SubscribeOnce ¶
func (t *Target) SubscribeOnce(ctx context.Context, req *gnmi.SubscribeRequest) ([]*gnmi.SubscribeResponse, error)
func (*Target) SubscribeOnceChan ¶ added in v0.21.0
func (t *Target) SubscribeOnceChan(ctx context.Context, req *gnmi.SubscribeRequest) (chan *gnmi.SubscribeResponse, chan error)
type TargetError ¶
Click to show internal directories.
Click to hide internal directories.