Documentation ¶
Index ¶
- Constants
- func DelDataFromDb(db keyval.ProtoTxn, key string) error
- func ExitWithError(code int, err error)
- func GetAgentLabel(key string) (agentLabel string)
- func GetDbForAllAgents(endpoints []string) (*kvproto.ProtoWrapper, error)
- func GetDbForOneAgent(endpoints []string, agentLabel string) (keyval.ProtoBroker, error)
- func GetModuleName(module proto.Message) string
- func WriteData(db keyval.ProtoTxn, key string, json string)
- type EtcdDump
- func (ed EtcdDump) PrintConfig(showConf bool) (*bytes.Buffer, error)
- func (ed EtcdDump) PrintStatus() (*bytes.Buffer, error)
- func (ed EtcdDump) ReadDataFromDb(db keyval.ProtoBroker, key string, agent string) (found bool, err error)
- func (ed EtcdDump) ReadStatusDataFromDb(db keyval.ProtoBroker, key string, agent string) (found bool, err error)
- type LogList
- type VppData
- type VppMetaData
- type VppStatusWithMD
Constants ¶
const ( ExitSuccess = iota ExitError ExitBadConnection ExitInvalidInput ExitBadFeature ExitInterrupted ExitIO ExitBadArgs = 128 )
Common exit flags
Variables ¶
This section is empty.
Functions ¶
func ExitWithError ¶
ExitWithError is used by all commands to print out an error and exit.
func GetAgentLabel ¶
func GetDbForAllAgents ¶
func GetDbForAllAgents(endpoints []string) (*kvproto.ProtoWrapper, error)
GetDbForAllAgents opens a connection to etcd, specified in the command line or the "ETCD_ENDPOINTS" environment variable.
func GetDbForOneAgent ¶
func GetDbForOneAgent(endpoints []string, agentLabel string) (keyval.ProtoBroker, error)
GetDbForOneAgent opens a connection to etcd, specified in the command line or the "ETCD_ENDPOINTS" environment variable.
func GetModuleName ¶
Types ¶
type EtcdDump ¶
EtcdDump is a map of VppData records. It constitutes a temporary storage for data retrieved from etcd. "Temporary" means during the execution of an agentctl command. Every command reads data from etcd first, then processes it, and finally either outputs the processed data to the user or updates one or more data records in etcd.
func NewEtcdDump ¶
func NewEtcdDump() EtcdDump
NewEtcdDump returns a new instance of the temporary storage that will hold data retrieved from etcd.
func (EtcdDump) ReadDataFromDb ¶
func (ed EtcdDump) ReadDataFromDb(db keyval.ProtoBroker, key string, agent string) (found bool, err error)
ReadDataFromDb reads a data record from etcd, parses it according to the expected record type and stores it in the EtcdDump temporary storage. A record is identified by a Key.
The function returns an error if the etcd client encountered an error. The function returns true if the specified item has been found.
func (EtcdDump) ReadStatusDataFromDb ¶
type VppData ¶
type VppData struct { Status map[string]VppStatusWithMD Config configurator.Config PrintConf bool ShowEtcd bool ShowConf bool }
VppData defines a structure to hold all etcd data records (of all types) for one VPP.
type VppMetaData ¶
VppMetaData defines the etcd metadata.
type VppStatusWithMD ¶
type VppStatusWithMD struct { VppMetaData status.AgentStatus }
VppStatusWithMD contains a VPP Status data record and its etcd metadata.