github.com/billybanfield/evergreen@v0.0.0-20170525200750-eeee692790f7/agent/comm/interface.go (about) 1 package comm 2 3 import ( 4 "net/http" 5 6 "github.com/evergreen-ci/evergreen/apimodels" 7 "github.com/evergreen-ci/evergreen/model" 8 "github.com/evergreen-ci/evergreen/model/distro" 9 "github.com/evergreen-ci/evergreen/model/task" 10 "github.com/evergreen-ci/evergreen/model/version" 11 "github.com/mongodb/grip/slogger" 12 ) 13 14 // TaskCommunicator is an interface that handles the remote procedure calls 15 // between an agent and the remote server. 16 type TaskCommunicator interface { 17 Start() error 18 End(detail *apimodels.TaskEndDetail) (*apimodels.EndTaskResponse, error) 19 GetTask() (*task.Task, error) 20 GetProjectRef() (*model.ProjectRef, error) 21 GetDistro() (*distro.Distro, error) 22 GetVersion() (*version.Version, error) 23 Log([]model.LogMessage) error 24 Heartbeat() (bool, error) 25 FetchExpansionVars() (*apimodels.ExpansionVars, error) 26 GetNextTask() (*apimodels.NextTaskResponse, error) 27 TryTaskGet(path string) (*http.Response, error) 28 TryTaskPost(path string, data interface{}) (*http.Response, error) 29 TryGet(path string) (*http.Response, error) 30 TryPostJSON(path string, data interface{}) (*http.Response, error) 31 SetTask(taskId, taskSecret string) 32 GetCurrentTaskId() string 33 SetSignalChan(chan Signal) 34 SetLogger(*slogger.Logger) 35 }