Documentation ¶
Index ¶
- Variables
- func DumpProcessMap()
- func NewSystemLibrary(lib libspector.Library) (sysLib systemLibrary, err error)
- func ShipProcessMap(a *Agent)
- type Agent
- func (agent *Agent) BuildAndSyncWatchers()
- func (agent *Agent) CloseWatches()
- func (agent *Agent) FirstRun() bool
- func (agent *Agent) Heartbeat() error
- func (agent *Agent) OnChange(w Watcher)
- func (agent *Agent) PerformUpgrade()
- func (agent *Agent) RegisterServer() error
- func (agent *Agent) StartPolling()
- func (agent *Agent) SyncAllFiles()
- type CanaryClient
- func (c *CanaryClient) CreateServer(srv *Server) (string, error)
- func (client *CanaryClient) FetchUpgradeablePackages() (map[string]string, error)
- func (client *CanaryClient) Heartbeat(uuid string, files Watchers) error
- func (client *CanaryClient) SendFile(path string, kind string, contents []byte) error
- func (client *CanaryClient) SendProcessState(match string, body []byte) error
- type ChangeHandler
- type Client
- type MockClient
- func (m *MockClient) CreateServer(_a0 *Server) (string, error)
- func (m *MockClient) FetchUpgradeablePackages() (map[string]string, error)
- func (m *MockClient) Heartbeat(_a0 string, _a1 Watchers) error
- func (m *MockClient) SendFile(_a0 string, _a1 string, _a2 []byte) error
- func (m *MockClient) SendProcessState(_a0 string, _a1 []byte) error
- type ProcessWatcher
- type Server
- type TextWatcher
- type UpgradeCommand
- type UpgradeSequence
- type Watcher
- type Watchers
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrApi = errors.New("api error") ErrDeprecated = errors.New("api deprecated") )
View Source
var CanaryVersion string
Functions ¶
func DumpProcessMap ¶
func DumpProcessMap()
func NewSystemLibrary ¶
func NewSystemLibrary(lib libspector.Library) (sysLib systemLibrary, err error)
func ShipProcessMap ¶
func ShipProcessMap(a *Agent)
Types ¶
type Agent ¶
func (*Agent) BuildAndSyncWatchers ¶
func (agent *Agent) BuildAndSyncWatchers()
func (*Agent) CloseWatches ¶
func (agent *Agent) CloseWatches()
This has to be called before exiting
func (*Agent) PerformUpgrade ¶
func (agent *Agent) PerformUpgrade()
func (*Agent) RegisterServer ¶
func (*Agent) SyncAllFiles ¶
func (agent *Agent) SyncAllFiles()
type CanaryClient ¶
type CanaryClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(apiKey string, server *Server) *CanaryClient
func (*CanaryClient) CreateServer ¶
func (c *CanaryClient) CreateServer(srv *Server) (string, error)
func (*CanaryClient) FetchUpgradeablePackages ¶
func (client *CanaryClient) FetchUpgradeablePackages() (map[string]string, error)
func (*CanaryClient) Heartbeat ¶
func (client *CanaryClient) Heartbeat(uuid string, files Watchers) error
func (*CanaryClient) SendFile ¶
func (client *CanaryClient) SendFile(path string, kind string, contents []byte) error
func (*CanaryClient) SendProcessState ¶
func (client *CanaryClient) SendProcessState(match string, body []byte) error
type ChangeHandler ¶
type ChangeHandler func(Watcher)
type MockClient ¶
func (*MockClient) CreateServer ¶
func (m *MockClient) CreateServer(_a0 *Server) (string, error)
func (*MockClient) FetchUpgradeablePackages ¶
func (m *MockClient) FetchUpgradeablePackages() (map[string]string, error)
func (*MockClient) SendFile ¶
func (m *MockClient) SendFile(_a0 string, _a1 string, _a2 []byte) error
func (*MockClient) SendProcessState ¶
func (m *MockClient) SendProcessState(_a0 string, _a1 []byte) error
type ProcessWatcher ¶
type Server ¶
type Server struct { Hostname string `json:"hostname"` Uname string `json:"uname"` Ip string `json:"ip"` Name string `json:"name"` UUID string `json:"uuid,omitempty"` Distro string `json:"distro,omitempty"` Release string `json:"release,omitempty"` Tags []string `json:"tags,omitempty"` }
type TextWatcher ¶
type UpgradeCommand ¶
type UpgradeSequence ¶
type UpgradeSequence []UpgradeCommand
type Watcher ¶
type Watcher interface { Start() Stop() }
func NewAllProcessWatcher ¶
func NewAllProcessWatcher(callback ChangeHandler) Watcher
func NewCommandOutputWatcher ¶
func NewCommandOutputWatcher(process string, callback ChangeHandler) Watcher
Process watchers track changes in the output of a command
func NewFileWatcher ¶
func NewFileWatcher(path string, callback ChangeHandler) Watcher
File watchers track changes in the contents of a file
func NewProcessWatcher ¶
func NewProcessWatcher(match string, callback ChangeHandler) Watcher
Source Files ¶
Click to show internal directories.
Click to hide internal directories.