Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) AddTarget(ctx context.Context, ...) diag.Diagnostics
- func (c *Client) Backoff(ctx context.Context, attempts int) bool
- func (c *Client) Get(ctx context.Context, device, path string) (*gnmi.GetResponse, diag.Diagnostics)
- func (c *Client) Set(ctx context.Context, device string, operations ...SetOperation) (*gnmi.SetResponse, diag.Diagnostics)
- type Device
- type SetOperation
- type SetOperationType
Constants ¶
View Source
const ( DefaultMaxRetries int = 2 DefaultBackoffMinDelay int = 4 DefaultBackoffMaxDelay int = 60 DefaultBackoffDelayFactor float64 = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Devices map[string]*Device
// Maximum number of retries
MaxRetries int
// Minimum delay between two retries
BackoffMinDelay int
// Maximum delay between two retries
BackoffMaxDelay int
// Backoff delay factor
BackoffDelayFactor float64
}
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, device, path string) (*gnmi.GetResponse, diag.Diagnostics)
func (*Client) Set ¶
func (c *Client) Set(ctx context.Context, device string, operations ...SetOperation) (*gnmi.SetResponse, diag.Diagnostics)
type SetOperation ¶
type SetOperation struct {
Path string
Body string
Operation SetOperationType
}
type SetOperationType ¶ added in v0.1.10
type SetOperationType string
const ( Update SetOperationType = "update" Replace SetOperationType = "replace" Delete SetOperationType = "delete" )
Click to show internal directories.
Click to hide internal directories.