gnmi

package
v0.51.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONIETFEncoding  = "json_ietf"
	Target            = "sonic"
	DefaultAddress    = "127.0.0.1:8080"
	AgentUser         = "hhagent"
	AgentPasswordFile = "agent-passwd"
)
View Source
const (
	PasswdLower   = "abcdefghijklmnopqrstuvwxyz"
	PasswdUpper   = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	PasswdDigits  = "0123456789"
	PasswdSymbols = "~!@#$%^&*()_+`-={}|[]\\:\"<>?,./"
	PasswdLength  = 32
)

Variables

View Source
var (
	DefaultUsers     = []string{"admin"}
	DefaultPasswords = []string{"YourPaSsWoRd"}
)

Functions

func Marshal

func Marshal(value ygot.ValidatedGoStruct) (map[string]any, error)

func RandomPassword

func RandomPassword() (string, error)

func Unmarshal

func Unmarshal(data []byte, dest ygot.ValidatedGoStruct) error

func UnmarshalWithOpts

func UnmarshalWithOpts(data []byte, dest ygot.ValidatedGoStruct, opts ...ytypes.UnmarshalOpt) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, address, username, password string) (*Client, error)

func NewInSONiC

func NewInSONiC(ctx context.Context, basedir string, skipAgentUserCreation bool) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, dest ygot.ValidatedGoStruct, options ...api.GNMIOption) error

func (*Client) GetWithOpts

func (c *Client) GetWithOpts(ctx context.Context, path string, dest ygot.ValidatedGoStruct, extract bool, options ...api.GNMIOption) error

func (*Client) Set

func (c *Client) Set(ctx context.Context, req *gnmi.SetRequest) error

type ExtractOpt

type ExtractOpt struct{}

func (ExtractOpt) IsUnmarshalOpt

func (ExtractOpt) IsUnmarshalOpt()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL