Add basic go client

This commit is contained in:
simon987
2019-03-30 11:17:28 -04:00
parent 26dee89672
commit e7672f47ed
7 changed files with 315 additions and 32 deletions

42
client/models.go Normal file
View File

@@ -0,0 +1,42 @@
package client
import "github.com/simon987/task_tracker/storage"
type Worker struct {
Id int64 `json:"id"`
Alias string `json:"alias,omitempty"`
Secret []byte `json:"secret"`
}
type CreateWorkerResponse struct {
Ok bool `json:"ok"`
Message string `json:"message"`
Content struct {
Worker *storage.Worker `json:"worker"`
} `json:"content"`
}
type AssignTaskResponse struct {
Ok bool `json:"ok"`
Message string `json:"message"`
RateLimitDelay float64 `json:"rate_limit_delay,omitempty"`
Content struct {
Task *storage.Task `json:"task"`
} `json:"content"`
}
type ReleaseTaskResponse struct {
Ok bool `json:"ok"`
Message string `json:"message"`
Content struct {
Updated bool `json:"updated"`
} `json:"content"`
}
type ProjectSecretResponse struct {
Ok bool `json:"ok"`
Message string `json:"message"`
Content struct {
Secret string `json:"secret"`
} `json:"content"`
}