memory

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory implements ApplicationStoreFactory and creates storage components backed by memory store.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new Factory.

func (*Factory) CreateApplicationStore

func (f *Factory) CreateApplicationStore() (types.ApplicationStore, error)

CreateApplicationStore implements storage.ApplicationStoreFactory

func (*Factory) Initialize

func (f *Factory) Initialize(logger *zap.Logger) error

Initialize implements storage.ApplicationStoreFactory

func (*Factory) Purge

func (f *Factory) Purge(ctx context.Context) error

Purge removes all data from the Factory's underlying memory store. This function is intended for testing purposes only and should not be used in production environments.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory implementation of ApplicationStore

func NewStore

func NewStore() *Store

NewStore creates a new in-memory store

func (*Store) CreateAgent

func (s *Store) CreateAgent(ctx context.Context, agent *types.Agent) error

func (*Store) CreateConfig

func (s *Store) CreateConfig(ctx context.Context, config *types.Config) error

func (*Store) CreateGroup

func (s *Store) CreateGroup(ctx context.Context, group *types.Group) error

func (*Store) DeleteAgent

func (s *Store) DeleteAgent(ctx context.Context, id uuid.UUID) error

func (*Store) DeleteGroup

func (s *Store) DeleteGroup(ctx context.Context, id string) error

func (*Store) GetAgent

func (s *Store) GetAgent(ctx context.Context, id uuid.UUID) (*types.Agent, error)

func (*Store) GetConfig

func (s *Store) GetConfig(ctx context.Context, id string) (*types.Config, error)

func (*Store) GetGroup

func (s *Store) GetGroup(ctx context.Context, id string) (*types.Group, error)

func (*Store) GetLatestConfigForAgent

func (s *Store) GetLatestConfigForAgent(ctx context.Context, agentID uuid.UUID) (*types.Config, error)

func (*Store) GetLatestConfigForGroup

func (s *Store) GetLatestConfigForGroup(ctx context.Context, groupID string) (*types.Config, error)

func (*Store) ListAgents

func (s *Store) ListAgents(ctx context.Context) ([]*types.Agent, error)

func (*Store) ListConfigs

func (s *Store) ListConfigs(ctx context.Context, filter types.ConfigFilter) ([]*types.Config, error)

func (*Store) ListGroups

func (s *Store) ListGroups(ctx context.Context) ([]*types.Group, error)

func (*Store) UpdateAgentEffectiveConfig

func (s *Store) UpdateAgentEffectiveConfig(ctx context.Context, id uuid.UUID, effectiveConfig string) error

func (*Store) UpdateAgentLastSeen

func (s *Store) UpdateAgentLastSeen(ctx context.Context, id uuid.UUID, lastSeen time.Time) error

func (*Store) UpdateAgentStatus

func (s *Store) UpdateAgentStatus(ctx context.Context, id uuid.UUID, status types.AgentStatus) error

Jump to

Keyboard shortcuts

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