Documentation ¶
Index ¶
- Constants
- Variables
- func AppendUrlParam(base *url.URL, paramName, paramValue string) *url.URL
- func AppendUrlPath(base *url.URL, path string) *url.URL
- func BaseDirOfPathWithWildcard(path string) string
- func CleanRegistration() error
- func Cleandir(log io.Writer, root string, allows ...string) error
- func CommandAnd(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandCleandir(s *BuildSession, cmd *protocol.BuildCommand) (err error)
- func CommandCompose(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandCond(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandDownloadArtifact(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandEcho(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandExec(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandExport(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandFail(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandGenerateTestReport(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandMkdirs(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandOr(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandReport(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandSecret(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandTest(s *BuildSession, cmd *protocol.BuildCommand) error
- func CommandUploadArtifact(s *BuildSession, cmd *protocol.BuildCommand) error
- func ComputeMd5(filePath string) (string, error)
- func Err(f string, args ...interface{}) error
- func Executors() map[string]Executor
- func GetAgentRuntimeInfo() *protocol.AgentRuntimeInfo
- func GetState(key string) string
- func GoServerRemoteClient(withClientCert bool) (*http.Client, error)
- func GoServerRootCAs() (*x509.CertPool, error)
- func GoServerTlsConfig(withClientCert bool) (*tls.Config, error)
- func Initialize()
- func Join(sep string, parts ...string) string
- func LogDebug(format string, v ...interface{})
- func LogInfo(format string, v ...interface{})
- func Mkdirs(path string) error
- func NotImplemented(s *BuildSession, cmd *protocol.BuildCommand) error
- func ParseChecksum(checksum string) map[string]string
- func ReadGoServerCACert() error
- func Register() error
- func SetState(key, value string)
- func Sprintf(f string, args ...interface{}) string
- func Start() error
- func UsableSpace() int64
- func UsableSpaceString() string
- type Artifacts
- func (u *Artifacts) DownloadDir(source *url.URL, destPath string) error
- func (u *Artifacts) DownloadFile(source *url.URL, destPath string) (err error)
- func (u *Artifacts) Upload(source, destPath string, destURL *url.URL) (err error)
- func (u *Artifacts) VerifyChecksum(srcPath, destPath, checksumFname string) error
- func (u *Artifacts) VerifyChecksumFile(srcFname, fname, checksumFname string) error
- type BuildConsole
- type BuildSession
- func (s *BuildSession) Close() error
- func (s *BuildSession) ConsoleLog(format string, a ...interface{})
- func (s *BuildSession) Env() []string
- func (s *BuildSession) ProcessCommand() error
- func (s *BuildSession) ReplaceEcho(name string, value interface{})
- func (s *BuildSession) Report(jobState string) *protocol.Report
- func (s *BuildSession) Run() error
- type Config
- type Error
- type Executor
- type Failure
- type FailureMessage
- type Logger
- type TestCase
- type UnitTestReport
- type WebsocketConnection
Constants ¶
View Source
const ( DefaultSecretMask = "********" DefaultCancelCommandTimeout = 25 * time.Second )
Variables ¶
View Source
var ( CancelCommandTimeout = DefaultCancelCommandTimeout CancelBuildTimeout = 30 * time.Second BuildDebugToConsoleLog = true )
View Source
var (
AgentId string
)
View Source
var UNIT_TEST_REPORT_TEMPLATE = `` /* 1774-byte string literal not displayed */
Functions ¶
func CleanRegistration ¶
func CleanRegistration() error
func CommandAnd ¶
func CommandAnd(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandCleandir ¶
func CommandCleandir(s *BuildSession, cmd *protocol.BuildCommand) (err error)
func CommandCompose ¶
func CommandCompose(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandCond ¶
func CommandCond(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandDownloadArtifact ¶
func CommandDownloadArtifact(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandEcho ¶
func CommandEcho(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandExec ¶
func CommandExec(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandExport ¶
func CommandExport(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandFail ¶
func CommandFail(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandGenerateTestReport ¶
func CommandGenerateTestReport(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandMkdirs ¶
func CommandMkdirs(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandOr ¶
func CommandOr(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandReport ¶
func CommandReport(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandSecret ¶
func CommandSecret(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandTest ¶
func CommandTest(s *BuildSession, cmd *protocol.BuildCommand) error
func CommandUploadArtifact ¶
func CommandUploadArtifact(s *BuildSession, cmd *protocol.BuildCommand) error
func ComputeMd5 ¶
func GetAgentRuntimeInfo ¶
func GetAgentRuntimeInfo() *protocol.AgentRuntimeInfo
func GoServerRootCAs ¶
func Initialize ¶
func Initialize()
func NotImplemented ¶
func NotImplemented(s *BuildSession, cmd *protocol.BuildCommand) error
func ParseChecksum ¶
func ReadGoServerCACert ¶
func ReadGoServerCACert() error
func UsableSpace ¶
func UsableSpace() int64
func UsableSpaceString ¶
func UsableSpaceString() string
Types ¶
type Artifacts ¶
type Artifacts struct {
// contains filtered or unexported fields
}
func (*Artifacts) DownloadDir ¶
func (*Artifacts) DownloadFile ¶
func (*Artifacts) VerifyChecksum ¶
func (*Artifacts) VerifyChecksumFile ¶
type BuildConsole ¶
type BuildConsole struct { Url *url.URL HttpClient *http.Client // contains filtered or unexported fields }
func MakeBuildConsole ¶
func MakeBuildConsole(httpClient *http.Client, url *url.URL) *BuildConsole
func (*BuildConsole) Close ¶
func (console *BuildConsole) Close() error
func (*BuildConsole) Flush ¶
func (console *BuildConsole) Flush()
type BuildSession ¶
type BuildSession struct {
// contains filtered or unexported fields
}
func MakeBuildSession ¶
func MakeBuildSession(buildId string, command *protocol.BuildCommand, console io.WriteCloser, artifacts *Artifacts, artifactUploadBaseURL *url.URL, send chan *protocol.Message, rootDir string) *BuildSession
func (*BuildSession) Close ¶
func (s *BuildSession) Close() error
func (*BuildSession) ConsoleLog ¶
func (s *BuildSession) ConsoleLog(format string, a ...interface{})
func (*BuildSession) Env ¶
func (s *BuildSession) Env() []string
func (*BuildSession) ProcessCommand ¶
func (s *BuildSession) ProcessCommand() error
func (*BuildSession) ReplaceEcho ¶
func (s *BuildSession) ReplaceEcho(name string, value interface{})
func (*BuildSession) Run ¶
func (s *BuildSession) Run() error
type Config ¶
type Config struct { Hostname string SendMessageTimeout time.Duration ServerUrl *url.URL ServerHostAndPort string ContextPath string WebSocketPath string RegistrationPath string TokenPath string WorkingDir string LogDir string ConfigDir string IpAddress string AgentAutoRegisterKey string AgentAutoRegisterResources string AgentAutoRegisterEnvironments string AgentAutoRegisterElasticAgentId string AgentAutoRegisterElasticPluginId string GoServerCAFile string AgentPrivateKeyFile string AgentCertFile string AgentIdFile string AgentTokenFile string OutputDebugLog bool }
func LoadConfig ¶
func LoadConfig() *Config
func (*Config) HttpsServerURL ¶
func (*Config) IsElasticAgent ¶
func (*Config) WssServerURL ¶
type Error ¶
type Error struct {
FailureMessage
}
type Executor ¶
type Executor func(session *BuildSession, cmd *protocol.BuildCommand) error
type Failure ¶
type Failure struct {
FailureMessage
}
type FailureMessage ¶
type FailureMessage struct {
StackTrace string
}
type Logger ¶
func MakeLogger ¶
type UnitTestReport ¶
type UnitTestReport struct { Tests int Failures int Skipped int Time float64 TestCases []*TestCase }
func (*UnitTestReport) Merge ¶
func (r *UnitTestReport) Merge(another *UnitTestReport)
type WebsocketConnection ¶
type WebsocketConnection struct { Conn *websocket.Conn Send chan *protocol.Message Received chan *protocol.Message }
func MakeWebsocketConnection ¶
func MakeWebsocketConnection(wsLoc, httpLoc string) (*WebsocketConnection, error)
func (*WebsocketConnection) Close ¶
func (wc *WebsocketConnection) Close()
Source Files ¶
- agent.go
- artifacts.go
- build_console.go
- build_session.go
- command_and.go
- command_cleandir.go
- command_compose.go
- command_cond.go
- command_download_artifact.go
- command_echo.go
- command_exec.go
- command_export.go
- command_fail.go
- command_generate_test_report.go
- command_mkdirs.go
- command_or.go
- command_report.go
- command_secret.go
- command_upload_artifact.go
- config.go
- diskspace.go
- logging.go
- not_implemented.go
- registration.go
- states.go
- test.go
- unit_test_report_template.go
- utils.go
- websocket.go
Click to show internal directories.
Click to hide internal directories.