Documentation ¶
Overview ¶
Package memory is an in-memory database used to store and retrieve groups
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrGroupNotFound = errors.New("pkg/group/memory: the group was not found in the repository")
)
Functions ¶
This section is empty.
Types ¶
type Repository ¶
Repository is a structure that implements the group package's Repository interface
func NewRepository ¶
func NewRepository() *Repository
NewRepository is a factory that returns a structure that implements the group package's Repository interface
func (*Repository) AddAgent ¶
func (r *Repository) AddAgent(group string, id uuid.UUID) error
AddAgent will add the provided Agent ID to the provided group name. If the group name does not exist, it will be created.
func (*Repository) Groups ¶
func (r *Repository) Groups() (groups []string)
Groups returns a list of all the created groups
func (*Repository) Members ¶
func (r *Repository) Members() (members map[string][]uuid.UUID)
Members returns a list of lists that contains all created groups and their Agent members
func (*Repository) RemoveAgent ¶
func (r *Repository) RemoveAgent(group string, id uuid.UUID) error
RemoveAgent removes an agent from a group
Click to show internal directories.
Click to hide internal directories.