Documentation ¶
Index ¶
- func GetMillis() int64
- func LatestVersion() semver.Version
- type SQLStore
- func (sqlStore *SQLStore) CreateCluster(cluster *model.Cluster) error
- func (sqlStore *SQLStore) CreateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
- func (sqlStore *SQLStore) CreateGroup(group *model.Group) error
- func (sqlStore *SQLStore) CreateInstallation(installation *model.Installation) error
- func (sqlStore *SQLStore) CreateWebhook(webhook *model.Webhook) error
- func (sqlStore *SQLStore) DeleteCluster(id string) error
- func (sqlStore *SQLStore) DeleteClusterInstallation(id string) error
- func (sqlStore *SQLStore) DeleteGroup(id string) error
- func (sqlStore *SQLStore) DeleteInstallation(id string) error
- func (sqlStore *SQLStore) DeleteWebhook(id string) error
- func (sqlStore *SQLStore) GetCluster(id string) (*model.Cluster, error)
- func (sqlStore *SQLStore) GetClusterInstallation(id string) (*model.ClusterInstallation, error)
- func (sqlStore *SQLStore) GetClusterInstallations(filter *model.ClusterInstallationFilter) ([]*model.ClusterInstallation, error)
- func (sqlStore *SQLStore) GetClusters(filter *model.ClusterFilter) ([]*model.Cluster, error)
- func (sqlStore *SQLStore) GetCurrentVersion() (semver.Version, error)
- func (sqlStore *SQLStore) GetGroup(id string) (*model.Group, error)
- func (sqlStore *SQLStore) GetGroups(filter *model.GroupFilter) ([]*model.Group, error)
- func (sqlStore *SQLStore) GetInstallation(id string) (*model.Installation, error)
- func (sqlStore *SQLStore) GetInstallations(filter *model.InstallationFilter) ([]*model.Installation, error)
- func (sqlStore *SQLStore) GetUnlockedClusterInstallationsPendingWork() ([]*model.ClusterInstallation, error)
- func (sqlStore *SQLStore) GetUnlockedClustersPendingWork() ([]*model.Cluster, error)
- func (sqlStore *SQLStore) GetUnlockedInstallationsPendingWork() ([]*model.Installation, error)
- func (sqlStore *SQLStore) GetWebhook(id string) (*model.Webhook, error)
- func (sqlStore *SQLStore) GetWebhooks(filter *model.WebhookFilter) ([]*model.Webhook, error)
- func (sqlStore *SQLStore) LockCluster(clusterID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockClusterInstallations(clusterInstallationIDs []string, lockerID string) (bool, error)
- func (sqlStore *SQLStore) LockInstallation(installationID, lockerID string) (bool, error)
- func (sqlStore *SQLStore) Migrate() error
- func (sqlStore *SQLStore) UnlockCluster(clusterID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockClusterInstallations(clusterInstallationIDs []string, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UnlockInstallation(installationID, lockerID string, force bool) (bool, error)
- func (sqlStore *SQLStore) UpdateCluster(cluster *model.Cluster) error
- func (sqlStore *SQLStore) UpdateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
- func (sqlStore *SQLStore) UpdateGroup(group *model.Group) error
- func (sqlStore *SQLStore) UpdateInstallation(installation *model.Installation) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMillis ¶
func GetMillis() int64
GetMillis is a convenience method to get milliseconds since epoch.
func LatestVersion ¶
LatestVersion returns the version to which the last migration migrates.
Types ¶
type SQLStore ¶
type SQLStore struct {
// contains filtered or unexported fields
}
SQLStore abstracts access to the database.
func MakeTestSQLStore ¶
func MakeTestSQLStore(tb testing.TB, logger log.FieldLogger) *SQLStore
MakeTestSQLStore creates a SQLStore for use with unit tests.
func New ¶
func New(dsn string, logger logrus.FieldLogger) (*SQLStore, error)
New constructs a new instance of SQLStore.
func (*SQLStore) CreateCluster ¶
CreateCluster records the given cluster to the database, assigning it a unique ID.
func (*SQLStore) CreateClusterInstallation ¶
func (sqlStore *SQLStore) CreateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
CreateClusterInstallation records the given cluster installation to the database, assigning it a unique ID.
func (*SQLStore) CreateGroup ¶
CreateGroup records the given group to the database, assigning it a unique ID.
func (*SQLStore) CreateInstallation ¶
func (sqlStore *SQLStore) CreateInstallation(installation *model.Installation) error
CreateInstallation records the given installation to the database, assigning it a unique ID.
func (*SQLStore) CreateWebhook ¶ added in v0.3.0
CreateWebhook records the given webhook to the database, assigning it a unique ID.
func (*SQLStore) DeleteCluster ¶
DeleteCluster marks the given cluster as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteClusterInstallation ¶
DeleteClusterInstallation marks the given cluster installation as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteGroup ¶
DeleteGroup marks the given group as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteInstallation ¶
DeleteInstallation marks the given installation as deleted, but does not remove the record from the database.
func (*SQLStore) DeleteWebhook ¶ added in v0.3.0
DeleteWebhook marks the given webhook as deleted, but does not remove the record from the database.
func (*SQLStore) GetCluster ¶
GetCluster fetches the given cluster by id.
func (*SQLStore) GetClusterInstallation ¶
func (sqlStore *SQLStore) GetClusterInstallation(id string) (*model.ClusterInstallation, error)
GetClusterInstallation fetches the given cluster installation by id.
func (*SQLStore) GetClusterInstallations ¶
func (sqlStore *SQLStore) GetClusterInstallations(filter *model.ClusterInstallationFilter) ([]*model.ClusterInstallation, error)
GetClusterInstallations fetches the given page of created clusters. The first page is 0.
func (*SQLStore) GetClusters ¶
GetClusters fetches the given page of created clusters. The first page is 0.
func (*SQLStore) GetCurrentVersion ¶
GetCurrentVersion queries the System table for the current database version.
func (*SQLStore) GetGroups ¶
GetGroups fetches the given page of created groups. The first page is 0.
func (*SQLStore) GetInstallation ¶
func (sqlStore *SQLStore) GetInstallation(id string) (*model.Installation, error)
GetInstallation fetches the given installation by id.
func (*SQLStore) GetInstallations ¶
func (sqlStore *SQLStore) GetInstallations(filter *model.InstallationFilter) ([]*model.Installation, error)
GetInstallations fetches the given page of created installations. The first page is 0.
func (*SQLStore) GetUnlockedClusterInstallationsPendingWork ¶
func (sqlStore *SQLStore) GetUnlockedClusterInstallationsPendingWork() ([]*model.ClusterInstallation, error)
GetUnlockedClusterInstallationsPendingWork returns an unlocked cluster installation in a pending state.
func (*SQLStore) GetUnlockedClustersPendingWork ¶
GetUnlockedClustersPendingWork returns an unlocked cluster in a pending state.
func (*SQLStore) GetUnlockedInstallationsPendingWork ¶
func (sqlStore *SQLStore) GetUnlockedInstallationsPendingWork() ([]*model.Installation, error)
GetUnlockedInstallationsPendingWork returns an unlocked installation in a pending state.
func (*SQLStore) GetWebhook ¶ added in v0.3.0
GetWebhook fetches the given webhook by id.
func (*SQLStore) GetWebhooks ¶ added in v0.3.0
GetWebhooks fetches the given page of created webhooks. The first page is 0.
func (*SQLStore) LockCluster ¶
LockCluster marks the cluster as locked for exclusive use by the caller.
func (*SQLStore) LockClusterInstallations ¶
func (sqlStore *SQLStore) LockClusterInstallations(clusterInstallationIDs []string, lockerID string) (bool, error)
LockClusterInstallations marks the cluster installation as locked for exclusive use by the caller.
func (*SQLStore) LockInstallation ¶
LockInstallation marks the installation as locked for exclusive use by the caller.
func (*SQLStore) Migrate ¶
Migrate advances the schema of the configured database to the latest version.
func (*SQLStore) UnlockCluster ¶
UnlockCluster releases a lock previously acquired against a caller.
func (*SQLStore) UnlockClusterInstallations ¶
func (sqlStore *SQLStore) UnlockClusterInstallations(clusterInstallationIDs []string, lockerID string, force bool) (bool, error)
UnlockClusterInstallations releases a lock previously acquired against a caller.
func (*SQLStore) UnlockInstallation ¶
func (sqlStore *SQLStore) UnlockInstallation(installationID, lockerID string, force bool) (bool, error)
UnlockInstallation releases a lock previously acquired against a caller.
func (*SQLStore) UpdateCluster ¶
UpdateCluster updates the given cluster in the database.
func (*SQLStore) UpdateClusterInstallation ¶
func (sqlStore *SQLStore) UpdateClusterInstallation(clusterInstallation *model.ClusterInstallation) error
UpdateClusterInstallation updates the given cluster installation in the database.
func (*SQLStore) UpdateGroup ¶
UpdateGroup updates the given group in the database.
func (*SQLStore) UpdateInstallation ¶
func (sqlStore *SQLStore) UpdateInstallation(installation *model.Installation) error
UpdateInstallation updates the given installation in the database.