Documentation ¶
Index ¶
- Constants
- func IsLoginPidError(err error) bool
- func MakeNodeRef(ps []string, startNode schema.Node) xutils.NodeRef
- type ConfirmedCommitInfo
- type Disp
- func (d *Disp) AuthAuthorize(path string, perm int) (bool, error)
- func (d *Disp) AuthGetPerms() (map[string]string, error)
- func (d *Disp) CallRpc(moduleIdOrNamespace, rpcName, args, encoding string) (string, error)
- func (d *Disp) CallRpcXml(moduleNamespace, name, args string) (string, error)
- func (d *Disp) CancelCommit(sid, comment, persistid string, force, debug bool) (string, error)
- func (d *Disp) Comment(sid string, path string) (bool, error)
- func (d *Disp) Commit(sid string, message string, debug bool) (string, error)
- func (d *Disp) CommitConfirm(sid string, message string, debug bool, mins int) (string, error)
- func (d *Disp) Compare(old, new, spath string, ctxdiff bool) (string, error)
- func (d *Disp) CompareConfigRevisions(sid, revOne, revTwo string) (string, error)
- func (d *Disp) CompareSessionChanges(sid string) (string, error)
- func (d *Disp) Confirm(sid string) (string, error)
- func (d *Disp) ConfirmPersistId(persistid string) (string, error)
- func (d *Disp) ConfirmSilent(sid string) (string, error)
- func (d *Disp) ConfirmedCommit(sid string, message string, confirmed bool, timeout string, persist string, ...) (string, error)
- func (d *Disp) ConfirmingCommit() (string, error)
- func (d *Disp) Copy(sid string, fpath string, tpath string) (bool, error)
- func (d *Disp) CopyConfig(...) (string, error)
- func (d *Disp) Delete(sid string, path string) (bool, error)
- func (d *Disp) Discard(sid string) (bool, error)
- func (d *Disp) EditConfigXML(...) (string, error)
- func (d *Disp) EditGetEnv(sid string) (map[string]string, error)
- func (d *Disp) Exists(db rpc.DB, sid string, path string) (bool, error)
- func (d *Disp) Expand(path string) (string, error)
- func (d *Disp) ExpandWithPrefix(path, prefix string, pos int) (string, error)
- func (d *Disp) ExtractArchive(sid, revision, destination string) (string, error)
- func (d *Disp) Get(db rpc.DB, sid string, path string) ([]string, error)
- func (d *Disp) GetCommitLog() (map[string]string, error)
- func (d *Disp) GetCompletions(sid string, schema bool, path string) (map[string]string, error)
- func (d *Disp) GetConfigSystemFeatures() (map[string]struct{}, error)
- func (d *Disp) GetDeviations() (map[string]string, error)
- func (d *Disp) GetFeatures() (map[string]string, error)
- func (d *Disp) GetHelp(sid string, schema bool, path string) (map[string]string, error)
- func (d *Disp) GetModuleSchemas() (string, error)
- func (d *Disp) GetSchemas() (string, error)
- func (d *Disp) Load(sid string, file string) (bool, error)
- func (d *Disp) LoadFrom(sid, source, routingInstance string) (bool, error)
- func (d *Disp) LoadKeys(sid, user, source, routingInstance string) (string, error)
- func (d *Disp) LoadReportWarnings(sid string, file string) (bool, error)
- func (d *Disp) Merge(sid string, file string) (bool, error)
- func (d *Disp) MergeReportWarnings(sid string, file string) (bool, error)
- func (d *Disp) MigrateConfigFile(file string) (string, error)
- func (d *Disp) NodeGetComment(sid string, path string) (map[string]int, error)
- func (d *Disp) NodeGetCompleteEnv(sid string, path string) (map[string]int, error)
- func (d *Disp) NodeGetStatus(db rpc.DB, sid string, path string) (rpc.NodeStatus, error)
- func (d *Disp) NodeGetType(sid string, path string) (rpc.NodeType, error)
- func (d *Disp) NodeIsDefault(db rpc.DB, sid string, path string) (bool, error)
- func (d *Disp) ReadConfigFile(file string) (string, error)
- func (d *Disp) ReadConfigFileRaw(file string) (string, error)
- func (d *Disp) Rename(sid string, fpath string, tpath string) (bool, error)
- func (d *Disp) Rollback(sid, revision, comment string, debug bool) (string, error)
- func (d *Disp) Save(_ string) (bool, error)
- func (d *Disp) SaveTo(dest, routingInstance string) (bool, error)
- func (d *Disp) SchemaGet(modOrSubmod string, format string) (string, error)
- func (d *Disp) SessionChanged(sid string) (bool, error)
- func (d *Disp) SessionExists(sid string) (bool, error)
- func (d *Disp) SessionGetEnv(sid string) (map[string]string, error)
- func (d *Disp) SessionLock(sid string) (int32, error)
- func (d *Disp) SessionLocked(sid string) (int32, error)
- func (d *Disp) SessionMarkSaved(sid string) (bool, error)
- func (d *Disp) SessionMarkUnsaved(sid string) (bool, error)
- func (d *Disp) SessionSaved(sid string) (bool, error)
- func (d *Disp) SessionSetup(sid string) (bool, error)
- func (d *Disp) SessionSetupShared(sid string) (bool, error)
- func (d *Disp) SessionTeardown(sid string) (bool, error)
- func (d *Disp) SessionUnlock(sid string) (int32, error)
- func (d *Disp) Set(sid string, path string) (string, error)
- func (d *Disp) SetConfigDebug(sid, logName, level string) (string, error)
- func (d *Disp) Show(db rpc.DB, sid string, path string, hideSecrets bool) (string, error)
- func (d *Disp) ShowConfigWithContextDiffs(sid string, path string, showDefaults bool) (string, error)
- func (d *Disp) ShowDefaults(db rpc.DB, sid string, path string, hideSecrets bool) (string, error)
- func (d *Disp) TmplGet(path string) (map[string]string, error)
- func (d *Disp) TmplGetAllowed(sid, path string) ([]string, error)
- func (d *Disp) TmplGetChildren(path string) ([]string, error)
- func (d *Disp) TmplValidatePath(path string) (bool, error)
- func (d *Disp) TmplValidateValues(path string) (bool, error)
- func (d *Disp) TreeGet(db rpc.DB, sid, path, encoding string, flags map[string]interface{}) (string, error)
- func (d *Disp) TreeGetFull(db rpc.DB, sid, path, encoding string, flags map[string]interface{}) (string, error)
- func (d *Disp) TreeGetFullWithWarnings(db rpc.DB, sid, path, encoding string, flags map[string]interface{}) (string, error, []error)
- func (d *Disp) Validate(sid string) (string, error)
- func (d *Disp) ValidateConfig(sid, encoding, config string) (string, error)
- func (d *Disp) ValidatePath(sid string, path string) (string, error)
- type LoginPidError
- type Srv
- type SrvConn
- type VciRpcCaller
Constants ¶
const ( NoPrefix = "TEST_NOT_USING_PREFIX" InvalidPos = -1 )
const (
DefaultTimeout = 600
)
Variables ¶
This section is empty.
Functions ¶
func IsLoginPidError ¶
func MakeNodeRef ¶
MakeNodeRef
Used to convert a config path string ([]string) to the NodeRef format that looks like a XPath leafref-type reference to a node.
NB:
(1) startNode represents root node (2) ps represents path to leaf / leaf-list schema node, but NOT to the value node underneath. Think of NodeRefs as references to a node generically, rather than to a specific value of that node. (3) All NodeRefs are absolute, not relative. (4) We generate a single element in the NodeRef for List+ListEntry. We get the key name from the List, and save it for use with the extra data we get from the ListEntry (5) This ought to be in configd/pathutil but with the schema reference we end up with a circular reference to packages via the configd/exec package and it all gets very messy trying to unentangle it. Exercise for the reader on another day ...
Types ¶
type ConfirmedCommitInfo ¶
type Disp ¶
type Disp struct {
// contains filtered or unexported fields
}
func (*Disp) CallRpcXml ¶
TODO: eventually remove this.
func (*Disp) CancelCommit ¶
func (*Disp) CommitConfirm ¶
func (*Disp) CompareConfigRevisions ¶
func (*Disp) CompareSessionChanges ¶
func (*Disp) ConfirmedCommit ¶
func (*Disp) ConfirmingCommit ¶
func (*Disp) CopyConfig ¶
func (*Disp) EditConfigXML ¶
func (*Disp) ExpandWithPrefix ¶
Allow for the scenario where a user types 'tab' when the cursor is mid-word, eg 'set interfaces datadp0' with the cursor on the 'd' of 'dp0'. We want to return 'set interfaces dataplanedp0' in this case rather than an error.
<prefix> shows text up to cursor in the word in <path> indicated by the index <pos>. <path> takes format '[/]0/1/2/...' ie indexed from zero, and with optional leading '/'.
If <pos> < 0 then <prefix> will never be used, maintaining the original behaviour of the Expand() API.
func (*Disp) ExtractArchive ¶
func (*Disp) GetCompletions ¶
func (*Disp) GetConfigSystemFeatures ¶
func (*Disp) GetModuleSchemas ¶
func (*Disp) GetSchemas ¶
func (*Disp) LoadKeys ¶
LoadKeys RPC This provides the implementation for the "loadkey" cfgcli command
func (*Disp) LoadReportWarnings ¶
func (*Disp) MergeReportWarnings ¶
func (*Disp) NodeGetComment ¶
func (*Disp) NodeGetCompleteEnv ¶
func (*Disp) NodeGetStatus ¶
func (*Disp) NodeGetType ¶
func (*Disp) NodeIsDefault ¶
func (*Disp) SetConfigDebug ¶
func (*Disp) ShowConfigWithContextDiffs ¶
func (*Disp) ShowDefaults ¶
func (*Disp) TreeGetFull ¶
func (*Disp) TreeGetFullWithWarnings ¶
func (d *Disp) TreeGetFullWithWarnings( db rpc.DB, sid, path, encoding string, flags map[string]interface{}, ) (string, error, []error)
TreeGetFullWithWarnings - full tree including state, with any warnings. Warnings are non-fatal, eg a specific node's state function(s) may have failed, but we can still return overall state and config. Error indicates a non-existent path typically - something we shouldn't ignore.
func (*Disp) ValidateConfig ¶
type LoginPidError ¶
type LoginPidError struct {
// contains filtered or unexported fields
}
func (*LoginPidError) Error ¶
func (e *LoginPidError) Error() string
type Srv ¶
type Srv struct { *net.UnixListener Dlog *log.Logger Elog *log.Logger Wlog *log.Logger Config *configd.Config CompMgr schema.ComponentManager // contains filtered or unexported fields }
func (*Srv) Log ¶
Log is a common place to do logging so that the implementation may change in the future.