Versions in this module Expand all Collapse all v0 v0.2.0 Dec 1, 2020 Changes in this version + const ProcessEventStart + const ProcessEventStderr + const ProcessEventStdout + const ProcessEventStop + var HTTPClient = &http.Client + var LongHTTPClient = &http.Client + func PushEvent(event EventInterface) + func Start() + type App struct + func NewApp(config *agents.AppConfig) *App + type EventInterface interface + AsJSON func() (data []byte, err error) + type Item struct + func NewItem(appId string, config *agents.Item) *Item + func (this *Item) Run() (value interface{}, err error) + func (this *Item) Schedule() + func (this *Item) Stop() + type ItemEvent struct + AgentId string + AppId string + BeginAt int64 + CostMs float64 + Error string + Event string + ItemId string + Timestamp int64 + Value interface{} + func NewItemEvent(agentId string, appId string, itemId string, value interface{}, err error, ...) *ItemEvent + func (this *ItemEvent) AsJSON() ([]byte, error) + type Process struct + Cwd string + Env []*shared.Variable + File string + Pid int + UniqueId string + func NewProcess() *Process + func (this *Process) Kill() error + func (this *Process) OnStart(f func()) + func (this *Process) OnStop(f func()) + func (this *Process) Run() (stdout string, stderr string, err error) + func (this *Process) RunWriter(stdout io.Writer, stderr io.Writer) (err error) + type ProcessEvent struct + AgentId string + AppId string + Data string + Event string + EventType ProcessEventType + Pid int + TaskId string + Timestamp int64 + UniqueId string + func NewProcessEvent(eventType ProcessEventType, appId string, taskId string, uniqueId string, ...) *ProcessEvent + func (this *ProcessEvent) AsJSON() ([]byte, error) + type ProcessEventType = string + type Server struct + Addr string + func NewServer() *Server + func (this *Server) Shutdown() + func (this *Server) Start() error + type StderrLogWriter struct + AppId string + Pid int + TaskId string + UniqueId string + func (this *StderrLogWriter) Write(p []byte) (n int, err error) + type StdoutLogWriter struct + AppId string + Pid int + TaskId string + UniqueId string + func (this *StdoutLogWriter) Write(p []byte) (n int, err error) + type Task struct + func NewTask(appId string, config *agents.TaskConfig) *Task + func (this *Task) IsRunning() bool + func (this *Task) Run() (proc *Process, stdout string, stderr string, err error) + func (this *Task) RunLog() (err error) + func (this *Task) Schedule(fromTimer ...bool) + func (this *Task) ShouldBoot() bool + func (this *Task) Stop() error