Adding support for a blockchain DB for agent history.

This commit is contained in:
James Wells 2021-10-26 13:21:44 -07:00
parent 0d0695d195
commit 5e69931ed7
Signed by: jwells
GPG key ID: 73196D10B8E65666
7 changed files with 199 additions and 147 deletions

View file

@ -17,13 +17,9 @@ type GagentConfig struct {
CMode bool
}
type Agent struct {
Client string
ScriptCode []byte
Hints []*string
}
// ClientDetails is details about known clients
/*
* ClientDetails are details about known clients
*/
type ClientDetails struct {
/*
* Client name for display purposes in logs and
@ -40,7 +36,9 @@ type ClientDetails struct {
ClientID string `hcl:"clientid,optional"`
}
// RouterDetails is details about known routers
/*
* RouterDetails is details about known routers
*/
type RouterDetails struct {
/*
* Router name for display purposes in logs and
@ -93,7 +91,9 @@ type RouterDetails struct {
RouterTags []string `hcl:"tags,optional"`
}
// WorkerDetails is details about known workers
/*
* WorkerDetails is details about known workers
*/
type WorkerDetails struct {
/*
* Router name for display purposes in logs and
@ -117,3 +117,15 @@ type WorkerDetails struct {
*/
WorkerTags []string `hcl:"tags,optional"`
}
type BlockChainDB struct {
DBName string `hcl:"chain_id,optional"`
Agents []*AgentDetails `hcl:"agent,block"`
}
type AgentDetails struct {
ScriptCode []byte
Hints []*string
Client string `hcl:"client"`
Shasum string `hcl:"shasum"`
Status string `hcl:"status"`
}