Documentation
¶
Overview ¶
Package agent is a service to manage Agent structures
Index ¶
- type Service
- func (s *Service) Add(agent agent.Agent)
- func (s *Service) AgentInfo() messages.AgentInfo
- func (s *Service) Get() agent.Agent
- func (s *Service) IncrementFailed()
- func (s *Service) SetAuthenticated(authenticated bool)
- func (s *Service) SetFailedCheckIn(failed int)
- func (s *Service) SetInitialCheckIn(checkin time.Time)
- func (s *Service) SetKillDate(date int64)
- func (s *Service) SetMaxRetry(retries int)
- func (s *Service) SetSkew(skew int64)
- func (s *Service) SetSleep(sleep time.Duration)
- func (s *Service) SetStatusCheckIn(checkin time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { AgentRepo agent.Repository ClientRepo clients.Repository }
Service is the structure used to interact with Agent objects
func NewAgentService ¶
func NewAgentService() *Service
NewAgentService is a factory that returns an Agent Service
func (*Service) AgentInfo ¶
func (s *Service) AgentInfo() messages.AgentInfo
AgentInfo builds an AgentInfo structure from the information stored in the Agent and Client repositories
func (*Service) Get ¶
Get returns the single Agent object stored in the repository, because there can only be one
func (*Service) IncrementFailed ¶
func (s *Service) IncrementFailed()
IncrementFailed increases the Agent's failed checkin count by one
func (*Service) SetAuthenticated ¶
SetAuthenticated updates the Agent's authenticated status
func (*Service) SetFailedCheckIn ¶
SetFailedCheckIn updates the number of times the Agent has already failed to check in with the provided value
func (*Service) SetInitialCheckIn ¶
SetInitialCheckIn updates the time stamp of when the Agent first successfully check in
func (*Service) SetKillDate ¶
SetKillDate updates the date, as an epoch timestamp, that the Agent will quit running
func (*Service) SetMaxRetry ¶
SetMaxRetry updates the number of times the Agent can fail to check in before it quits running
func (*Service) SetSkew ¶
SetSkew updates the amount of jitter or skew that is applied to an Agent's sleep time
func (*Service) SetStatusCheckIn ¶
SetStatusCheckIn updates the time stamp of when this Agent last successfully connected to the Server or parent Agent