tmpl

package
v0.0.0-...-c19ee7d Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause, MPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpTmpl

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

OpTmpl represents an operational mode template

func NewOpTmpl

func NewOpTmpl(allowed, help, comptype, run string) *OpTmpl

NewOpTmpl creates a new operational template with the provided field values

func (*OpTmpl) Allowed

func (t *OpTmpl) Allowed() string

Allowed returns the allowed field's value

func (*OpTmpl) Comptype

func (t *OpTmpl) Comptype() string

Comptype returns the comptype field's value

func (*OpTmpl) Features

func (t *OpTmpl) Features() string

func (*OpTmpl) GetField

func (t *OpTmpl) GetField(name string) (string, error)

GetField returns the value for the provided field.

func (*OpTmpl) Help

func (t *OpTmpl) Help() string

Help returns the help field's value

func (*OpTmpl) Include

func (t *OpTmpl) Include() string

Include returns the link field's value

func (*OpTmpl) Local

func (t *OpTmpl) Local() bool

Local returns true if the script should be run on the client

func (*OpTmpl) Map

func (t *OpTmpl) Map() map[string]string

Map converts a OpTmpl to a map of fields to values

func (*OpTmpl) PassOpcArgs

func (t *OpTmpl) PassOpcArgs() bool

PassOpcArgs returns true if the command is requesting OPC_ARGS in its environment

func (*OpTmpl) Priv

func (t *OpTmpl) Priv() bool

Priv returns true if the code will have root permissions

func (*OpTmpl) Run

func (t *OpTmpl) Run() string

Run returns the run field's value

func (*OpTmpl) Secret

func (t *OpTmpl) Secret() bool

Secret returns true if the command holds sensitive information

func (*OpTmpl) SetAllowed

func (t *OpTmpl) SetAllowed(v string)

SetAllowed overwrites the allowed field's value

func (*OpTmpl) SetComptype

func (t *OpTmpl) SetComptype(v string)

SetComptype overwrites the comptype field's value

func (*OpTmpl) SetFeatures

func (t *OpTmpl) SetFeatures(v string)

func (*OpTmpl) SetHelp

func (t *OpTmpl) SetHelp(v string)

SetHelp overwrites the help field's value

func (*OpTmpl) SetInclude

func (t *OpTmpl) SetInclude(v string)

SetInclude overwrites the link field's value

func (*OpTmpl) SetLocal

func (t *OpTmpl) SetLocal(v bool)

SetLocal overwrites sets priv field of the template

func (*OpTmpl) SetPassOpcArgs

func (t *OpTmpl) SetPassOpcArgs(v bool)

SetPassOpcArgs overwrites the passOpcArgs field of the template

func (*OpTmpl) SetPriv

func (t *OpTmpl) SetPriv(v bool)

SetPriv overwrites sets priv field of the template

func (*OpTmpl) SetRun

func (t *OpTmpl) SetRun(v string)

SetRun overwrites the run field's value

func (*OpTmpl) SetSecret

func (t *OpTmpl) SetSecret(v bool)

SetSecret overwrites the secret field of the template

func (*OpTmpl) SetYang

func (t *OpTmpl) SetYang(v bool)

func (*OpTmpl) String

func (t *OpTmpl) String() string

String generates a string represnetation of the operational mode template

func (*OpTmpl) Yang

func (t *OpTmpl) Yang() bool

Directories

Path Synopsis
Package parse is a simple parser for operational mode templates.
Package parse is a simple parser for operational mode templates.
Package tree is an nary tree that stores operational mode templates using maps of strings to nodes as the linkage mechanism.
Package tree is an nary tree that stores operational mode templates using maps of strings to nodes as the linkage mechanism.

Jump to

Keyboard shortcuts

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