2021-02-25 17:46:40 -08:00
|
|
|
package gstructs
|
|
|
|
|
|
|
|
// GagentConfig is the primary construct used by all modes
|
|
|
|
type GagentConfig struct {
|
2021-11-08 06:58:55 -08:00
|
|
|
Name string `hcl:"name,optional"`
|
|
|
|
Mode string `hcl:"mode,attr"`
|
|
|
|
UUID string `hcl:"uuid,optional"`
|
|
|
|
MonitorPort int `hcl:"monitorport,optional"`
|
|
|
|
ListenAddr string `hcl:"listenaddr,optional"`
|
|
|
|
ClientPort int64 `hcl:"clientport,optional"`
|
|
|
|
RouterPort int64 `hcl:"routerport,optional"`
|
|
|
|
WorkerPort int64 `hcl:"workerport,optional"`
|
|
|
|
Clients []*ClientDetails `hcl:"client,block"`
|
|
|
|
Routers []*RouterDetails `hcl:"router,block"`
|
|
|
|
Workers []*WorkerDetails `hcl:"worker,block"`
|
|
|
|
Version string
|
|
|
|
File string
|
|
|
|
CMode bool
|
2021-10-25 12:43:10 -07:00
|
|
|
}
|
|
|
|
|
2021-10-26 13:21:44 -07:00
|
|
|
/*
|
|
|
|
* ClientDetails are details about known clients
|
|
|
|
*/
|
2021-02-25 17:46:40 -08:00
|
|
|
type ClientDetails struct {
|
|
|
|
/*
|
|
|
|
* Client name for display purposes in logs and
|
|
|
|
* diagnostics.
|
|
|
|
*/
|
|
|
|
ClientName string `hcl:",label"`
|
|
|
|
|
|
|
|
/*
|
|
|
|
* UUID String for the client node. This is used by
|
|
|
|
* the router to determine which MQ client to send
|
|
|
|
* the agent's results to. This attempts to keep the
|
|
|
|
* clients unique globally.
|
|
|
|
*/
|
2021-05-21 23:03:50 +00:00
|
|
|
ClientID string `hcl:"clientid,optional"`
|
2021-02-25 17:46:40 -08:00
|
|
|
}
|
|
|
|
|
2021-10-26 13:21:44 -07:00
|
|
|
/*
|
|
|
|
* RouterDetails is details about known routers
|
|
|
|
*/
|
2021-02-25 17:46:40 -08:00
|
|
|
type RouterDetails struct {
|
|
|
|
/*
|
|
|
|
* Router name for display purposes in logs and
|
|
|
|
* diagnostics
|
|
|
|
*/
|
|
|
|
RouterName string `hcl:",label"`
|
|
|
|
|
|
|
|
/*
|
|
|
|
* UUID String for the router node. This is used by
|
|
|
|
* the clients, routers, and workers to determine
|
|
|
|
* which MQ router to send the agent's requests to.
|
|
|
|
* This attempts to keep the routers unique globally.
|
|
|
|
*/
|
2021-05-21 23:03:50 +00:00
|
|
|
RouterID string `hcl:"routerid,attr"`
|
2021-02-25 17:46:40 -08:00
|
|
|
|
|
|
|
/*
|
2021-04-03 16:39:33 -07:00
|
|
|
* This is the IP address or hostname the router
|
2021-02-25 17:46:40 -08:00
|
|
|
* will listen on. The router will start up a 0MQ
|
|
|
|
* service that clients and workers will connect to.
|
|
|
|
*/
|
|
|
|
RouterAddr string `hcl:"address,attr"`
|
|
|
|
|
2021-04-03 16:39:33 -07:00
|
|
|
/*
|
|
|
|
* This is the is the port that the router listens
|
2021-05-21 23:03:50 +00:00
|
|
|
* on for clients. If not defined, it will default
|
|
|
|
* to 35571.
|
2021-04-03 16:39:33 -07:00
|
|
|
*/
|
2021-05-21 23:03:50 +00:00
|
|
|
ClientPort int64 `hcl:"clientport,optional"`
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the is the port that the router listens
|
|
|
|
* on for routers. If not defined, it will default
|
|
|
|
* to 35570.
|
|
|
|
*/
|
2021-10-26 16:12:46 -07:00
|
|
|
RouterPort int64 `hcl:"routerport,optional"`
|
2021-05-21 23:03:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the is the port that the router listens
|
|
|
|
* on for clients. If not defined, it will default
|
|
|
|
* to 35572.
|
|
|
|
*/
|
|
|
|
WorkerPort int64 `hcl:"workerport,optional"`
|
2021-04-03 16:39:33 -07:00
|
|
|
|
2021-02-25 17:46:40 -08:00
|
|
|
/*
|
|
|
|
* These tags will be passed to the router upon
|
|
|
|
* connection. The router will then use these
|
|
|
|
* tags to help determine which worker / client
|
|
|
|
* to send the client's requests and results to.
|
|
|
|
*/
|
|
|
|
RouterTags []string `hcl:"tags,optional"`
|
|
|
|
}
|
|
|
|
|
2021-10-26 13:21:44 -07:00
|
|
|
/*
|
|
|
|
* WorkerDetails is details about known workers
|
|
|
|
*/
|
2021-02-25 17:46:40 -08:00
|
|
|
type WorkerDetails struct {
|
|
|
|
/*
|
|
|
|
* Router name for display purposes in logs and
|
|
|
|
* diagnostics
|
|
|
|
*/
|
|
|
|
WorkerName string `hcl:",label"`
|
|
|
|
|
|
|
|
/*
|
|
|
|
* UUID String for the worker node. This is used
|
|
|
|
* by the router to determine which MQ client to
|
|
|
|
* send agents to. This attempts to keep the
|
|
|
|
* workers unique globally.
|
|
|
|
*/
|
2021-05-21 23:03:50 +00:00
|
|
|
WorkerID string `hcl:"workerid,attr"`
|
2021-02-25 17:46:40 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* These tags will be passed to the router upon
|
|
|
|
* connection. The router will then use these
|
|
|
|
* tags to help determine which worker / client
|
|
|
|
* to send the agent and it's results to.
|
|
|
|
*/
|
|
|
|
WorkerTags []string `hcl:"tags,optional"`
|
|
|
|
}
|
2021-10-26 13:21:44 -07:00
|
|
|
|
|
|
|
type BlockChainDB struct {
|
2021-11-03 15:09:02 -07:00
|
|
|
DBName string `hcl:"chainid,optional"`
|
2021-10-26 13:21:44 -07:00
|
|
|
Agents []*AgentDetails `hcl:"agent,block"`
|
|
|
|
}
|
|
|
|
type AgentDetails struct {
|
|
|
|
Client string `hcl:"client"`
|
|
|
|
Shasum string `hcl:"shasum"`
|
|
|
|
Status string `hcl:"status"`
|
2021-11-03 15:09:02 -07:00
|
|
|
ScriptCode []byte
|
2021-11-08 06:58:55 -08:00
|
|
|
Hints []string
|
2021-10-26 13:21:44 -07:00
|
|
|
}
|