Documentation ¶
Index ¶
- Constants
- func CompressFiles(paths ...string) ([]byte, error)
- func DecompressFiles(b []byte, dir string) error
- func FormatTopicID(id string) string
- func FormatTopicTag(tag string) string
- type Announcement
- type Build
- type Deploy
- type Header
- type Log
- type LogRequest
- type Message
- type Package
- type Pipe
- type RequestWrapper
- type Response
- type Target
- type TargetBase
- type Task
- type UnixTimeType
Constants ¶
View Source
const ( TopicSeperator = ":" OperationSubscribe = "SUB" OperationUnsubscribe = "UNSUB" PipeConnected = "CONN" PipeDisconnected = "DISCONN" )
View Source
const ( // Request types (should not contain PrefixSeparator or TopicSeperator chars) RequestTargetAll = "ALL" RequestTargetID = "ID" RequestTargetTag = "TAG" // Stage types StageBuild = "build" StageTransfer = "transfer" StageInstall = "install" StageRun = "run" // Topic consts PrefixSeparator = "-" // Task types TaskTypeBuild = 1 TaskTypeDeploy = 2 )
View Source
const ( // Response types (topics) ResponseLog = "LOG" // logs ResponseAdvertisement = "ADV" // device advertisement ResponsePackage = "PKG" // assembled artifacts // Log output constants ExecStart = "EXEC-START" ExecEnd = "EXEC-END" StageStart = "STAGE-START" StageEnd = "STAGE-END" CommandByAgent = "$agent" CommandByManager = "$manager" )
Variables ¶
This section is empty.
Functions ¶
func CompressFiles ¶ added in v0.5.0
CompressFiles reads from given path and compresses in memory
func DecompressFiles ¶ added in v0.5.0
DecompressFiles decompresses from memory and writes to given directory
func FormatTopicID ¶ added in v0.5.0
func FormatTopicTag ¶ added in v0.5.0
Types ¶
type Announcement ¶ added in v0.5.0
Announcement carries information about a task
type Header ¶ added in v0.5.0
type Header struct { ID string `json:"id"` Debug bool `json:"debug,omitempty"` Created UnixTimeType `json:"createdAt"` }
Header contains information that is common among task related structs
type Log ¶
type Log struct { Task string `json:"task,omitempty"` Stage string `json:"stage,omitempty"` Command string `json:"command,omitempty"` // TODO is command unique within a stage? Output string `json:"output,omitempty"` Error bool `json:"error,omitempty"` Time UnixTimeType `json:"time,omitempty"` Debug bool `json:"-"` }
type LogRequest ¶
type LogRequest struct {
IfModifiedSince UnixTimeType
}
type Pipe ¶
Pipe is a bi-directional channel structure
for communication between the clients and manager/agent
type RequestWrapper ¶ added in v0.5.0
type RequestWrapper struct { Announcement *Announcement `json:"a,omitempty"` LogRequest *LogRequest `json:"l,omitempty"` Command *string `json:"c,omitempty"` }
RequestWrapper is the struct of messages sent to request topics
type Target ¶
type Target struct { TargetBase AutoGenID string `json:"autoID,omitempty"` // active task TaskID string `json:"taskID"` TaskDebug bool `json:"taskDebug,omitempty"` TaskRun []string `json:"taskRun,omitempty"` TaskRunAutoRestart bool `json:"taskRunAutoRestart,omitempty"` TaskHistory map[string]uint8 `json:"taskHistory,omitempty"` }
type TargetBase ¶ added in v0.6.0
type Task ¶
type Task struct { Header Build *Build `json:"bl,omitempty"` Deploy *Deploy `json:"de,omitempty"` Artifacts []byte `json:"ar,omitempty"` }
Task is a struct with all the information for deployment on a target
Click to show internal directories.
Click to hide internal directories.