Versions in this module Expand all Collapse all v0 v0.2.1 Oct 26, 2018 v0.2.0 Oct 23, 2018 Changes in this version + const SvcDescription + const SvcDisplayName + const SvcName + var Agent *Engine + var AgentHomeDir = `/opt/laforge-agent` — darwin/amd64, js/wasm, linux/amd64 + var AgentHomeDir = `C:\laforge-agent` — windows/amd64 + var AsyncWorker *Worker + var ErrAwaitingReboot = errors.New("awaiting reboot for step") + var ErrDuplicateRevision = errors.New("duplicate revision already loaded") + var ErrInProgress = errors.New("step currently in progress") + var ErrLoadTimedOut = errors.New("agent worker timed out loading state") + var ErrRevisionMismatch = errors.New("requested revision is ahead of currently running") + var ErrStaleRevision = errors.New("requested revision is out of date") + var ErrStepFailure = errors.New("current step has errored") + var ErrWorkerBusy = errors.New("agent worker busy") + var ExePath = `/usr/local/bin/laforge-agent` — darwin/amd64, js/wasm, linux/amd64 + var ExePath = `C:\Windows\System32\laforge-agent.exe` — windows/amd64 + var LogFile *os.File + var Logger *logrus.Logger + var ServerPort = 9971 + func AssetDir() string + func AssetPath(name string) string + func ConfigFile() string + func CreateAgentDir() error + func GetService() (service.Service, error) + func GetServiceConfig() *service.Config + func InitFile() string + func Initialized() bool + func LogFilePath() string + func StartLogger() error + func StepLogDir() string + func TouchInitFile() error + type Engine struct + Config *State + Server *gin.Engine + Service service.Service + func NewEngine() *Engine + func (e *Engine) GetStatus() *Status + func (e *Engine) LoadConfig() error + func (e *Engine) ReqGetAwaitingSteps(c *gin.Context) + func (e *Engine) ReqGetCompletedSteps(c *gin.Context) + func (e *Engine) ReqGetCurrentStep(c *gin.Context) + func (e *Engine) ReqGetSpecificStep(c *gin.Context) + func (e *Engine) ReqGetState(c *gin.Context) + func (e *Engine) ReqGetStatus(c *gin.Context) + func (e *Engine) ReqGetStepLogAll(c *gin.Context) + func (e *Engine) ReqGetStepLogStderr(c *gin.Context) + func (e *Engine) ReqGetStepLogStdout(c *gin.Context) + func (e *Engine) ReqGetSteps(c *gin.Context) + func (e *Engine) ReqInitialize(c *gin.Context) + func (e *Engine) ReqPushProvision(c *gin.Context) + func (e *Engine) ReqSelfDestruct(c *gin.Context) + func (e *Engine) Serve() + func (e *Engine) Start(s service.Service) error + func (e *Engine) Stop(s service.Service) error + type LoadRequest struct + Ack chan bool + Err chan error + Source string + type State struct + Competition *core.Competition + Completed map[int]*Step + CompletedAt time.Time + CurrentState string + CurrentStep *Step + Environment *core.Environment + ErrorMessage string + Errored bool + Host *core.Host + InitializedAt time.Time + Network *core.Network + Pending map[int]*Step + ProvisionedHost *core.ProvisionedHost + RenderedAt time.Time + Revision int64 + Source string + Steps []*Step + Team *core.Team + func LoadStateFile(location string) (*State, error) + func (s *State) DoNextStep() error + func (s *State) Finalize() error + func (s *State) Normalize() error + func (s *State) ResolveNextStep() (*Step, error) + func (s *State) WorkExists() bool + func (s *State) WriteStateFile(location string) error + type Status struct + Code StatusCode + CompletedAt time.Time + CompletedSteps int + CurrentStep *Step + ElapsedTime time.Duration + StartedAt time.Time + TotalSteps int + Uptime int64 + func NewEmptyStatus() *Status + type StatusCode string + const StatusAwaitingReboot + const StatusBootingUp + const StatusDestroying + const StatusIdle + const StatusRefreshing + const StatusRunningStep + type Step struct + Description string + Destination string + EndedAt time.Time + ExitError error + ExitStatus int + ID int + Metadata map[string]interface{} + Name string + Revision string + Source string + StartedAt time.Time + Status string + Stderr *bytes.Buffer + StderrFile string + Stdout *bytes.Buffer + StdoutFile string + StepType string + func (s *Step) CanProceed() bool + func (s *Step) CopyFile() error + func (s *Step) ExecuteLinux() error + func (s *Step) ExecutePowershell() error + func (s *Step) ExecuteWindows() error + func (s *Step) Perform() error + func (s *Step) Prepare() error + func (s *Step) RunCommand(base string, args ...string) error + func (s *Step) StderrFilename() string + func (s *Step) StdoutFilename() string + type Worker struct + Busy bool + Config *State + ConfigFile string + Heartbeat int64 + Tasks chan LoadRequest + func (w *Worker) Available() bool + func (w *Worker) Do() + func (w *Worker) Handle(lr LoadRequest) + func (w *Worker) Load(statefile string) error + func (w *Worker) Rest() + func (w *Worker) Spawn()