Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) AddTarget(ctx context.Context, device, host, username, password string) 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, path, body string, operation SetOperation) (*gnmi.SetResponse, diag.Diagnostics)
- type Device
- type SetOperation
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, path, body string, operation SetOperation) (*gnmi.SetResponse, diag.Diagnostics)
type SetOperation ¶
type SetOperation string
const ( Update SetOperation = "update" Replace SetOperation = "replace" Delete SetOperation = "delete" )
Click to show internal directories.
Click to hide internal directories.