agent

package
v2.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package agent is a service to manage Agent structures

Index

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) Add

func (s *Service) Add(agent agent.Agent)

Add stores the provided agent object in the repository

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

func (s *Service) Get() agent.Agent

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

func (s *Service) SetAuthenticated(authenticated bool)

SetAuthenticated updates the Agent's authenticated status

func (*Service) SetFailedCheckIn

func (s *Service) SetFailedCheckIn(failed int)

SetFailedCheckIn updates the number of times the Agent has already failed to check in with the provided value

func (*Service) SetInitialCheckIn

func (s *Service) SetInitialCheckIn(checkin time.Time)

SetInitialCheckIn updates the time stamp of when the Agent first successfully check in

func (*Service) SetKillDate

func (s *Service) SetKillDate(date int64)

SetKillDate updates the date, as an epoch timestamp, that the Agent will quit running

func (*Service) SetMaxRetry

func (s *Service) SetMaxRetry(retries int)

SetMaxRetry updates the number of times the Agent can fail to check in before it quits running

func (*Service) SetSkew

func (s *Service) SetSkew(skew int64)

SetSkew updates the amount of jitter or skew that is applied to an Agent's sleep time

func (*Service) SetSleep

func (s *Service) SetSleep(sleep time.Duration)

SetSleep updates the amount of time an Agent will sleep between checkins

func (*Service) SetStatusCheckIn

func (s *Service) SetStatusCheckIn(checkin time.Time)

SetStatusCheckIn updates the time stamp of when this Agent last successfully connected to the Server or parent Agent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL