summaryrefslogtreecommitdiff
path: root/types.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-07-13 07:55:44 +0100
committerKatolaZ <katolaz@freaknet.org>2017-07-13 07:55:44 +0100
commit00c61083d7139f19b8d99dfc7ac6d7e22c4f9a78 (patch)
tree942623175a650be1c98694e0f2e05640df49d9df /types.go
parentb2b083e0597d3277f5dc075f4b17c89de51a77d0 (diff)
master and worker initialisation (draft)
Diffstat (limited to 'types.go')
-rw-r--r--types.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/types.go b/types.go
index b14a103..3ccb6cc 100644
--- a/types.go
+++ b/types.go
@@ -15,22 +15,22 @@ const (
// the SCORSHmsg type represents messages received from the spool and
// sent to workers
type SCORSHmsg struct {
+ name string
repo string
branch string
old_rev string
new_rev string
}
-
type SCORSHcmd struct {
- URL string
- hash string
+ URL string `yaml:"c_url"`
+ Hash string `yaml:"c_hash"`
}
type SCORSHtag struct {
- TagName string
- Keyrings []string
- Commands []SCORSHcmd
+ Name string `yaml:"t_name"`
+ Keyrings []string `yaml:"t_keyrings"`
+ Commands []SCORSHcmd `yaml:"t_commands"`
}
// Configuration of a worker
@@ -45,16 +45,17 @@ type SCORSHworker_cfg struct {
// State of a worker
type SCORSHworker_state struct {
- Tags map[string]SCORSHtag
- Keys map[string]openpgp.KeyRing
- Chan chan SCORSHmsg
+ Tags []SCORSHtag `yaml:"w_tags"`
+ Keys map[string]openpgp.KeyRing
+ MsgChan chan SCORSHmsg
+ StatusChan chan SCORSHmsg
}
// The type SCORSHworker represents the configuration and state of a
// worker
type SCORSHworker struct {
- SCORSHworker_cfg
- SCORSHworker_state
+ SCORSHworker_cfg `yaml:",inline"`
+ SCORSHworker_state `yaml:",inline"`
}
// Configuration of the master
@@ -67,13 +68,15 @@ type SCORSHmaster_cfg struct {
// State of the master
type SCORSHmaster_state struct {
- Spooler chan SCORSHmsg
- Repos map[string][]*SCORSHworker
+ Spooler chan SCORSHmsg
+ StatusChan chan SCORSHmsg
+ Repos map[string][]*SCORSHworker
+ WorkingMsg map[string]int
}
// The type SCORSHmaster represents the configuration and state of the
// master
type SCORSHmaster struct {
- SCORSHmaster_cfg
+ SCORSHmaster_cfg `yaml:",inline"`
SCORSHmaster_state
}