netconf

package
v0.0.0-...-8aeced7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ApplyGroupXML = `<load-configuration action="merge" format="xml">
	%s
</load-configuration>
`

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Close() error
	DeleteConfig(applyGroup string, commit bool) (string, error)
	SendCommit() error
	MarshalGroup(id string, obj interface{}) error
	SendTransaction(id string, obj interface{}, commit bool) error
}

func NewClient

func NewClient(username string, password string, sshKey string, address string, port int) (Client, error)

NewClient returns go-netconf new client driver

type GoNCClient

type GoNCClient struct {
	Driver driver.Driver
	Lock   sync.RWMutex
}

GoNCClient type for storing data and wrapping functions

func (*GoNCClient) Close

func (g *GoNCClient) Close() error

Close is a functional thing to close the Driver

func (*GoNCClient) DeleteConfig

func (g *GoNCClient) DeleteConfig(applyGroup string, commit bool) (string, error)

DeleteConfig is a wrapper for driver.SendRaw()

func (*GoNCClient) MarshalGroup

func (g *GoNCClient) MarshalGroup(id string, obj interface{}) error

MarshalGroup accepts a struct of type X and then marshals data onto it

func (*GoNCClient) SendApplyGroups

func (g *GoNCClient) SendApplyGroups() error

This function is a helper used to send apply-groups to the device in chronological order

func (*GoNCClient) SendCommit

func (g *GoNCClient) SendCommit() error

SendCommit is a wrapper for driver.SendRaw()

func (*GoNCClient) SendTransaction

func (g *GoNCClient) SendTransaction(id string, obj interface{}, commit bool) error

SendTransaction is a method that unmarshal the XML, creates the transaction and passes in a commit

Jump to

Keyboard shortcuts

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