message

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 message is a service to process and return Agent Base messages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Agent         uuid.UUID
	ClientService *client.Service
	P2PService    *p2p.Service
	JobService    *job.Service
}

Service is the structure used to interact with message objects

func NewMessageService

func NewMessageService(agent uuid.UUID) *Service

NewMessageService is the factory to create a new service for handling base messages

func (*Service) Check

func (s *Service) Check() (msg messages.Base)

Check does not block but looks to see if there are any jobs or delegates that need to be returned to the Merlin server

func (*Service) Get

func (s *Service) Get() (msg messages.Base)

Get blocks until there is a return base message to send back to the Merlin server

func (*Service) GetDelegates

func (s *Service) GetDelegates()

GetDelegates blocks waiting for a delegate message that needs to be returned to the Merlin server and adds it to the out channel as a Base message type of CHECKIN because it will not be aggregated with other return message types. Used when the Agent doesn't sleep and only communicates when there is a message to send

func (*Service) GetJobs

func (s *Service) GetJobs()

GetJobs blocks waiting for a return job to exist, adds it to a Base message, and adds it to the out channel. Used when the Agent doesn't sleep and only communicates when there is a message to send

func (*Service) Handle

func (s *Service) Handle(msg messages.Base) (err error)

Handle processes incoming Base messages for this Agent

func (*Service) Store

func (s *Service) Store(msg messages.Base)

Store adds a Base message to the out channel to be sent back to the Merlin server Used when there is an error sending a message, and it needs to be preserved

Jump to

Keyboard shortcuts

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