protocol

package
v0.0.0-...-a6c55ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildPassed   = "Passed"
	BuildFailed   = "Failed"
	BuildCanceled = "Cancelled"
)
View Source
const (
	TestReportFileName = "index.html"

	RunIfConfigAny    = "any"
	RunIfConfigPassed = "passed"
	ExecInput         = ""

	CommandCompose             = "compose"
	CommandCond                = "cond"
	CommandAnd                 = "and"
	CommandOr                  = "or"
	CommandExport              = "export"
	CommandTest                = "test"
	CommandExec                = "exec"
	CommandEcho                = "echo"
	CommandUploadArtifact      = "uploadArtifact"
	CommandReportCurrentStatus = "reportCurrentStatus"
	CommandReportCompleting    = "reportCompleting"
	CommandMkdirs              = "mkdirs"
	CommandCleandir            = "cleandir"
	CommandFail                = "fail"
	CommandSecret              = "secret"
	CommandDownloadFile        = "downloadFile"
	CommandDownloadDir         = "downloadDir"
	CommandGenerateTestReport  = "generateTestReport"
	CommandGenerateProperty    = "generateProperty"
)
View Source
const (
	SetCookieAction           = "setCookie"
	CancelBuildAction         = "cancelBuild"
	ReregisterAction          = "reregister"
	BuildAction               = "build"
	PingAction                = "ping"
	AckAction                 = "acknowledge"
	ReportCurrentStatusAction = "reportCurrentStatus"
	ReportCompletingAction    = "reportCompleting"
	ReportCompletedAction     = "reportCompleted"
	AssignWorkAction          = "assignWork"
	ConsoleOutActon           = "consoleOut"
)

Variables

This section is empty.

Functions

func SendMessage

func SendMessage(conn *websocket.Conn, msg *Message) error

Types

type AgentBuildingInfo

type AgentBuildingInfo struct {
	BuildingInfo string `json:"buildingInfo"`
	BuildLocator string `json:"buildLocator"`
}

type AgentIdentifier

type AgentIdentifier struct {
	HostName  string `json:"hostName"`
	IpAddress string `json:"ipAddress"`
	Uuid      string `json:"uuid"`
}

type AgentRuntimeInfo

type AgentRuntimeInfo struct {
	Identifier                   *AgentIdentifier   `json:"identifier"`
	BuildingInfo                 *AgentBuildingInfo `json:"buildingInfo"`
	RuntimeStatus                string             `json:"runtimeStatus"`
	Location                     string             `json:"location"`
	UsableSpace                  int64              `json:"usableSpace"`
	OperatingSystemName          string             `json:"operatingSystemName"`
	Cookie                       string             `json:"cookie"`
	AgentLauncherVersion         string             `json:"agentLauncherVersion"`
	ElasticPluginId              string             `json:"elasticPluginId"`
	ElasticAgentId               string             `json:"elasticAgentId"`
	SupportsBuildCommandProtocol bool               `json:"supportsBuildCommandProtocol"`
}

type Build

type Build struct {
	BuildId                string
	BuildLocator           string
	BuildLocatorForDisplay string
	ConsoleUrl             string
	ArtifactUploadBaseUrl  string
	PropertyBaseUrl        string
	BuildCommand           *BuildCommand
}

func NewBuild

func NewBuild(id, locator, locatorForDisplay,
	consoleUrl, artifactUploadBaseUrl, propertyBaseUrl string,
	commands ...*BuildCommand) *Build

type BuildCommand

type BuildCommand struct {
	Name             string
	Args             map[string]string
	RunIfConfig      string
	ExecInput        string
	SubCommands      []*BuildCommand
	WorkingDirectory string
	Test             *BuildCommand
	OnCancel         *BuildCommand
}

func AndCommand

func AndCommand(commands ...*BuildCommand) *BuildCommand

func CleandirCommand

func CleandirCommand(path string, allows ...string) *BuildCommand

func ComposeCommand

func ComposeCommand(commands ...*BuildCommand) *BuildCommand

func CondCommand

func CondCommand(commands ...*BuildCommand) *BuildCommand

func DownloadCommand

func DownloadCommand(file_or_dir, src, url, dest, checksumUrl, checksumPath string) *BuildCommand

func DownloadDirCommand

func DownloadDirCommand(src, url, dest, checksumUrl, checksumPath string) *BuildCommand

func DownloadFileCommand

func DownloadFileCommand(src, url, dest, checksumUrl, checksumPath string) *BuildCommand

func EchoCommand

func EchoCommand(line string) *BuildCommand

func ExecCommand

func ExecCommand(args ...string) *BuildCommand

func ExportCommand

func ExportCommand(kvs ...string) *BuildCommand

func FailCommand

func FailCommand(msg string) *BuildCommand

func GenerateTestReportCommand

func GenerateTestReportCommand(args ...string) *BuildCommand

func MkdirsCommand

func MkdirsCommand(path string) *BuildCommand

func NewBuildCommand

func NewBuildCommand(name string) *BuildCommand

func OrCommand

func OrCommand(commands ...*BuildCommand) *BuildCommand

func ReportCompletingCommand

func ReportCompletingCommand() *BuildCommand

func ReportCurrentStatusCommand

func ReportCurrentStatusCommand(jobState string) *BuildCommand

func SecretCommand

func SecretCommand(vs ...string) *BuildCommand

func TestCommand

func TestCommand(args ...string) *BuildCommand

func UploadArtifactCommand

func UploadArtifactCommand(src, dest, ignoreUnmatchError string) *BuildCommand

func (*BuildCommand) AddArg

func (cmd *BuildCommand) AddArg(name, value string) *BuildCommand

func (*BuildCommand) AddCommands

func (cmd *BuildCommand) AddCommands(commands ...*BuildCommand) *BuildCommand

func (*BuildCommand) AddListArg

func (cmd *BuildCommand) AddListArg(name string, list []string) *BuildCommand

func (*BuildCommand) ListArg

func (cmd *BuildCommand) ListArg(name string) (list []string, err error)

func (*BuildCommand) RunIf

func (cmd *BuildCommand) RunIf(c string) *BuildCommand

func (*BuildCommand) RunIfAny

func (cmd *BuildCommand) RunIfAny() bool

func (*BuildCommand) RunIfMatch

func (cmd *BuildCommand) RunIfMatch(buildStatus string) bool

func (*BuildCommand) SetArgs

func (cmd *BuildCommand) SetArgs(args map[string]string) *BuildCommand

func (*BuildCommand) SetExecInput

func (cmd *BuildCommand) SetExecInput(input string) *BuildCommand

func (*BuildCommand) SetOnCancel

func (cmd *BuildCommand) SetOnCancel(c *BuildCommand) *BuildCommand

func (*BuildCommand) SetTest

func (cmd *BuildCommand) SetTest(test *BuildCommand) *BuildCommand

func (*BuildCommand) Setwd

func (cmd *BuildCommand) Setwd(wd string) *BuildCommand

type Message

type Message struct {
	Action        string `json:"action"`
	Data          string `json:"data"`
	AcknowledgeId string `json:"acknowledgementId"`
}

func AckMessage

func AckMessage(ackId string) *Message

func BuildMessage

func BuildMessage(cmd *Build) *Message

func CancelMessage

func CancelMessage() *Message

func CompletedMessage

func CompletedMessage(report *Report) *Message

func PingMessage

func PingMessage(data *AgentRuntimeInfo) *Message

func ReceiveMessage

func ReceiveMessage(conn *websocket.Conn) (*Message, error)

func ReportMessage

func ReportMessage(t string, report *Report) *Message

func ReregisterMessage

func ReregisterMessage() *Message

func SetCookieMessage

func SetCookieMessage(cookie string) *Message

func (*Message) AgentRuntimeInfo

func (m *Message) AgentRuntimeInfo() *AgentRuntimeInfo

func (*Message) DataBuild

func (m *Message) DataBuild() *Build

func (*Message) DataString

func (m *Message) DataString() string

func (*Message) Report

func (m *Message) Report() *Report

type Registration

type Registration struct {
	AgentPrivateKey, AgentCertificate string
}

type Report

type Report struct {
	BuildId          string            `json:"buildId"`
	Result           string            `json:"result"`
	JobState         string            `json:"jobState"`
	AgentRuntimeInfo *AgentRuntimeInfo `json:"agentRuntimeInfo"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL