Documentation
¶
Overview ¶
Package store provides concrete persistence implementations backing the persistence interfaces defined in pkg/store (currently SQLite).
Index ¶
- type DeploymentStore
- func (ds DeploymentStore) CreateDeployment(ctx context.Context, deployment *store.Deployment) error
- func (ds DeploymentStore) GetDeployment(ctx context.Context, id string) (*store.Deployment, error)
- func (ds DeploymentStore) ListDeployments(ctx context.Context, limit, offset int) ([]*store.Deployment, error)
- func (ds DeploymentStore) UpdateDeploymentStatus(ctx context.Context, id, status string) error
- type InstanceStore
- func (s *InstanceStore) GetAccessToken(ctx context.Context) (string, error)
- func (s *InstanceStore) GetBootstrapToken(ctx context.Context) (string, error)
- func (s *InstanceStore) GetInstance(ctx context.Context) (*store.Instance, error)
- func (s *InstanceStore) RegisterInstance(ctx context.Context, i *store.Instance) error
- func (s *InstanceStore) SetAccessToken(ctx context.Context, token string) error
- func (s *InstanceStore) SetBootstrapToken(ctx context.Context, token string) error
- func (s *InstanceStore) UpdateLastInstalledAt(ctx context.Context) error
- type ServiceStore
- func (s ServiceStore) CreateService(ctx context.Context, svc *store.Service) (*store.Service, error)
- func (s ServiceStore) GetService(ctx context.Context, id string) (*store.Service, error)
- func (s ServiceStore) ListServices(ctx context.Context, limit, offset int) ([]*store.Service, error)
- func (s ServiceStore) UpdateService(ctx context.Context, svc *store.Service) error
- type TaskResultStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeploymentStore ¶
type DeploymentStore struct {
// contains filtered or unexported fields
}
func NewDeploymentStore ¶
func NewDeploymentStore(db *sql.DB) *DeploymentStore
func (DeploymentStore) CreateDeployment ¶
func (ds DeploymentStore) CreateDeployment(ctx context.Context, deployment *store.Deployment) error
func (DeploymentStore) GetDeployment ¶
func (ds DeploymentStore) GetDeployment(ctx context.Context, id string) (*store.Deployment, error)
func (DeploymentStore) ListDeployments ¶
func (ds DeploymentStore) ListDeployments(ctx context.Context, limit, offset int) ([]*store.Deployment, error)
func (DeploymentStore) UpdateDeploymentStatus ¶
func (ds DeploymentStore) UpdateDeploymentStatus(ctx context.Context, id, status string) error
type InstanceStore ¶
type InstanceStore struct {
// contains filtered or unexported fields
}
InstanceStore provides DB-backed access to the single local instance record.
func NewInstanceStore ¶
func NewInstanceStore(db *sql.DB) *InstanceStore
func (*InstanceStore) GetAccessToken ¶
func (s *InstanceStore) GetAccessToken(ctx context.Context) (string, error)
func (*InstanceStore) GetBootstrapToken ¶
func (s *InstanceStore) GetBootstrapToken(ctx context.Context) (string, error)
func (*InstanceStore) GetInstance ¶
func (*InstanceStore) RegisterInstance ¶
func (*InstanceStore) SetAccessToken ¶
func (s *InstanceStore) SetAccessToken(ctx context.Context, token string) error
func (*InstanceStore) SetBootstrapToken ¶
func (s *InstanceStore) SetBootstrapToken(ctx context.Context, token string) error
func (*InstanceStore) UpdateLastInstalledAt ¶
func (s *InstanceStore) UpdateLastInstalledAt(ctx context.Context) error
type ServiceStore ¶
type ServiceStore struct {
// contains filtered or unexported fields
}
func NewServiceStore ¶
func NewServiceStore(db *sql.DB, ds *DeploymentStore) *ServiceStore
func (ServiceStore) CreateService ¶
func (ServiceStore) GetService ¶
func (ServiceStore) ListServices ¶
func (ServiceStore) UpdateService ¶
type TaskResultStore ¶
type TaskResultStore struct {
// contains filtered or unexported fields
}
TaskResultStore implements store.TaskResultStore using SQLite.
func NewTaskResultStore ¶
func NewTaskResultStore(db *sql.DB) *TaskResultStore
func (*TaskResultStore) ListUnsent ¶
func (s *TaskResultStore) ListUnsent(ctx context.Context) ([]*store.TaskResult, error)
func (*TaskResultStore) MarkSynced ¶
func (s *TaskResultStore) MarkSynced(ctx context.Context, ids []string) error
func (*TaskResultStore) SaveResults ¶
func (s *TaskResultStore) SaveResults(ctx context.Context, results []*store.TaskResult) error
Click to show internal directories.
Click to hide internal directories.