summaryrefslogtreecommitdiff
path: root/workers.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-08-07 09:46:27 +0100
committerKatolaZ <katolaz@freaknet.org>2017-08-07 09:46:27 +0100
commitd3105e671a19fec1060652531ce783227fb9fab6 (patch)
treeeec4fd66285ef2d65f4c52a55c07780906fdea10 /workers.go
parent587c8bf41568c9624f9874bb4e2549227c1e3b63 (diff)
type renamed to avoid the SCORSH prefix
Diffstat (limited to 'workers.go')
-rw-r--r--workers.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/workers.go b/workers.go
index 84bd670..1d67770 100644
--- a/workers.go
+++ b/workers.go
@@ -13,7 +13,7 @@ import (
// Matches returns true if the configured repo:branch of the worker
// matches the repo and branch provided as arguments
-func (w *SCORSHworker) Matches(repo, branch string) bool {
+func (w *worker) Matches(repo, branch string) bool {
for _, r := range w.Repos {
parts := strings.SplitN(r, ":", 2)
@@ -32,7 +32,7 @@ func (w *SCORSHworker) Matches(repo, branch string) bool {
// LoadKeyrings loads the configured keyrings for all the commands
// managed by the worker
-func (w *SCORSHworker) LoadKeyrings() error {
+func (w *worker) LoadKeyrings() error {
w.Keys = make(map[string]openpgp.KeyRing)
w.TagKeys = make(map[string]map[string]bool)
@@ -72,7 +72,7 @@ func (w *SCORSHworker) LoadKeyrings() error {
}
// LoadTags loads all the configured commands for the worker
-func (w *SCORSHworker) LoadTags() error {
+func (w *worker) LoadTags() error {
wTags, err := ioutil.ReadFile(w.Tagfile)
if err != nil {
@@ -90,9 +90,9 @@ func (w *SCORSHworker) LoadTags() error {
}
//
-func runWorker(w *SCORSHworker) {
+func runWorker(w *worker) {
- var msg SCORSHmsg
+ var msg spoolMsg
log.Printf("[worker: %s] Started\n", w.Name)
@@ -116,8 +116,8 @@ func runWorker(w *SCORSHworker) {
}
// StartWorkers starts all the workers specified in a given
-// configuration and fills in the SCORSHmaster struct
-func startWorkers(master *SCORSHmaster) error {
+// configuration and fills in the master struct
+func startWorkers(master *master) error {
numWorkers := len(master.Workers)
@@ -130,7 +130,7 @@ func startWorkers(master *SCORSHmaster) error {
worker := &(master.Workers[w])
// Set the Status and Msg channels
worker.StatusChan = master.StatusChan
- worker.MsgChan = make(chan SCORSHmsg, 10)
+ worker.MsgChan = make(chan spoolMsg, 10)
// Load worker tags from worker.Tagfile
err := worker.LoadTags()