Documentation
¶
Index ¶
- Constants
- Variables
- func NewSQLiteStorage(dbPath string, logger *zap.Logger) (types.ApplicationStore, error)
- type Factory
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) CreateAgent(ctx context.Context, agent *types.Agent) error
- func (s *Storage) CreateConfig(ctx context.Context, config *types.Config) error
- func (s *Storage) CreateGroup(ctx context.Context, group *types.Group) error
- func (s *Storage) DeleteAgent(ctx context.Context, id uuid.UUID) error
- func (s *Storage) DeleteGroup(ctx context.Context, id string) error
- func (s *Storage) GetAgent(ctx context.Context, id uuid.UUID) (*types.Agent, error)
- func (s *Storage) GetConfig(ctx context.Context, id string) (*types.Config, error)
- func (s *Storage) GetGroup(ctx context.Context, id string) (*types.Group, error)
- func (s *Storage) GetLatestConfigForAgent(ctx context.Context, agentID uuid.UUID) (*types.Config, error)
- func (s *Storage) GetLatestConfigForGroup(ctx context.Context, groupID string) (*types.Config, error)
- func (s *Storage) ListAgents(ctx context.Context) ([]*types.Agent, error)
- func (s *Storage) ListConfigs(ctx context.Context, filter types.ConfigFilter) ([]*types.Config, error)
- func (s *Storage) ListGroups(ctx context.Context) ([]*types.Group, error)
- func (s *Storage) UpdateAgentEffectiveConfig(ctx context.Context, id uuid.UUID, effectiveConfig string) error
- func (s *Storage) UpdateAgentLastSeen(ctx context.Context, id uuid.UUID, lastSeen time.Time) error
- func (s *Storage) UpdateAgentStatus(ctx context.Context, id uuid.UUID, status types.AgentStatus) error
Constants ¶
View Source
const InitialSchema = `` /* 3224-byte string literal not displayed */
InitialSchema creates the initial SQLite database schema
View Source
const SchemaVersion = 1
Variables ¶
View Source
var Migrations = []string{ InitialSchema, }
Migrations is a list of all schema migrations
Functions ¶
func NewSQLiteStorage ¶
NewSQLiteStorage creates a new SQLite storage instance
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory implements ApplicationStoreFactory and creates storage components backed by SQLite.
func NewFactory ¶
NewFactory creates a new Factory with the given database path.
func (*Factory) CreateApplicationStore ¶
func (f *Factory) CreateApplicationStore() (types.ApplicationStore, error)
CreateApplicationStore implements storage.ApplicationStoreFactory
func (*Factory) Initialize ¶
Initialize implements storage.ApplicationStoreFactory
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage implements the ApplicationStore interface using SQLite
func (*Storage) CreateAgent ¶
Agent management
func (*Storage) CreateConfig ¶
Config management
func (*Storage) CreateGroup ¶
Group management
func (*Storage) DeleteAgent ¶
func (*Storage) GetLatestConfigForAgent ¶
func (*Storage) GetLatestConfigForGroup ¶
func (*Storage) ListAgents ¶
func (*Storage) ListConfigs ¶
func (*Storage) ListGroups ¶
func (*Storage) UpdateAgentEffectiveConfig ¶
func (*Storage) UpdateAgentLastSeen ¶
func (*Storage) UpdateAgentStatus ¶
Click to show internal directories.
Click to hide internal directories.