Documentation ¶
Index ¶
- Variables
- func IsErrForeignKeyViolation(err error) bool
- func IsErrNotFound(err error) bool
- type ApiKey
- type ApiKeyStore
- type ApiKeys
- type Database
- func (db *Database) ApiKeys(ctx context.Context, team string) (ApiKeys, error)
- func (db *Database) Deployment(ctx context.Context, id string) (*Deployment, error)
- func (db *Database) DeploymentResources(ctx context.Context, deploymentID string) ([]DeploymentResource, error)
- func (db *Database) DeploymentStatus(ctx context.Context, deploymentID string) ([]DeploymentStatus, error)
- func (db *Database) Deployments(ctx context.Context, teams, clusters, ignoreTeams []string, limit int) ([]*Deployment, error)
- func (db *Database) HistoricDeployments(ctx context.Context, cluster string, timestamp time.Time) ([]*Deployment, error)
- func (db *Database) Migrate(ctx context.Context) error
- func (db *Database) ReadRepositoryTeams(ctx context.Context, repository string) ([]string, error)
- func (db *Database) RotateApiKey(ctx context.Context, team string, key api_v1.Key) error
- func (db *Database) WriteDeployment(ctx context.Context, deployment Deployment) error
- func (db *Database) WriteDeploymentResource(ctx context.Context, resource DeploymentResource) error
- func (db *Database) WriteDeploymentStatus(ctx context.Context, status DeploymentStatus) error
- func (db *Database) WriteRepositoryTeams(ctx context.Context, repository string, teams []string) error
- type Deployment
- type DeploymentResource
- type DeploymentStatus
- type DeploymentStore
- type MockApiKeyStore
- type MockDeploymentStore
- func (_m *MockDeploymentStore) Deployment(ctx context.Context, id string) (*Deployment, error)
- func (_m *MockDeploymentStore) DeploymentResources(ctx context.Context, deploymentID string) ([]DeploymentResource, error)
- func (_m *MockDeploymentStore) DeploymentStatus(ctx context.Context, deploymentID string) ([]DeploymentStatus, error)
- func (_m *MockDeploymentStore) Deployments(ctx context.Context, teams []string, clusters []string, ignoreTeams []string, ...) ([]*Deployment, error)
- func (_m *MockDeploymentStore) HistoricDeployments(ctx context.Context, cluster string, timestamp time.Time) ([]*Deployment, error)
- func (_m *MockDeploymentStore) WriteDeployment(ctx context.Context, deployment Deployment) error
- func (_m *MockDeploymentStore) WriteDeploymentResource(ctx context.Context, resource DeploymentResource) error
- func (_m *MockDeploymentStore) WriteDeploymentStatus(ctx context.Context, status DeploymentStatus) error
- type MockRepositoryTeamStore
- type RepositoryTeamStore
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = fmt.Errorf("database row not found")
Functions ¶
func IsErrForeignKeyViolation ¶
Returns true if the error message is a foreign key constraint violation
func IsErrNotFound ¶
Types ¶
type ApiKeyStore ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) Deployment ¶
func (*Database) DeploymentResources ¶
func (*Database) DeploymentStatus ¶
func (*Database) Deployments ¶
func (*Database) HistoricDeployments ¶
func (*Database) ReadRepositoryTeams ¶
func (*Database) RotateApiKey ¶
func (*Database) WriteDeployment ¶
func (db *Database) WriteDeployment(ctx context.Context, deployment Deployment) error
func (*Database) WriteDeploymentResource ¶
func (db *Database) WriteDeploymentResource(ctx context.Context, resource DeploymentResource) error
func (*Database) WriteDeploymentStatus ¶
func (db *Database) WriteDeploymentStatus(ctx context.Context, status DeploymentStatus) error
type Deployment ¶
type DeploymentResource ¶
type DeploymentStatus ¶
type DeploymentStore ¶
type DeploymentStore interface { Deployments(ctx context.Context, teams, clusters, ignoreTeams []string, limit int) ([]*Deployment, error) Deployment(ctx context.Context, id string) (*Deployment, error) HistoricDeployments(ctx context.Context, cluster string, timestamp time.Time) ([]*Deployment, error) WriteDeployment(ctx context.Context, deployment Deployment) error DeploymentStatus(ctx context.Context, deploymentID string) ([]DeploymentStatus, error) WriteDeploymentStatus(ctx context.Context, status DeploymentStatus) error DeploymentResources(ctx context.Context, deploymentID string) ([]DeploymentResource, error) WriteDeploymentResource(ctx context.Context, resource DeploymentResource) error }
type MockApiKeyStore ¶
MockApiKeyStore is an autogenerated mock type for the ApiKeyStore type
func NewMockApiKeyStore ¶
func NewMockApiKeyStore(t interface { mock.TestingT Cleanup(func()) }) *MockApiKeyStore
NewMockApiKeyStore creates a new instance of MockApiKeyStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockApiKeyStore) RotateApiKey ¶
RotateApiKey provides a mock function with given fields: ctx, team, key
type MockDeploymentStore ¶
MockDeploymentStore is an autogenerated mock type for the DeploymentStore type
func NewMockDeploymentStore ¶
func NewMockDeploymentStore(t interface { mock.TestingT Cleanup(func()) }) *MockDeploymentStore
NewMockDeploymentStore creates a new instance of MockDeploymentStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockDeploymentStore) Deployment ¶
func (_m *MockDeploymentStore) Deployment(ctx context.Context, id string) (*Deployment, error)
Deployment provides a mock function with given fields: ctx, id
func (*MockDeploymentStore) DeploymentResources ¶
func (_m *MockDeploymentStore) DeploymentResources(ctx context.Context, deploymentID string) ([]DeploymentResource, error)
DeploymentResources provides a mock function with given fields: ctx, deploymentID
func (*MockDeploymentStore) DeploymentStatus ¶
func (_m *MockDeploymentStore) DeploymentStatus(ctx context.Context, deploymentID string) ([]DeploymentStatus, error)
DeploymentStatus provides a mock function with given fields: ctx, deploymentID
func (*MockDeploymentStore) Deployments ¶
func (_m *MockDeploymentStore) Deployments(ctx context.Context, teams []string, clusters []string, ignoreTeams []string, limit int) ([]*Deployment, error)
Deployments provides a mock function with given fields: ctx, teams, clusters, ignoreTeams, limit
func (*MockDeploymentStore) HistoricDeployments ¶
func (_m *MockDeploymentStore) HistoricDeployments(ctx context.Context, cluster string, timestamp time.Time) ([]*Deployment, error)
HistoricDeployments provides a mock function with given fields: ctx, cluster, timestamp
func (*MockDeploymentStore) WriteDeployment ¶
func (_m *MockDeploymentStore) WriteDeployment(ctx context.Context, deployment Deployment) error
WriteDeployment provides a mock function with given fields: ctx, deployment
func (*MockDeploymentStore) WriteDeploymentResource ¶
func (_m *MockDeploymentStore) WriteDeploymentResource(ctx context.Context, resource DeploymentResource) error
WriteDeploymentResource provides a mock function with given fields: ctx, resource
func (*MockDeploymentStore) WriteDeploymentStatus ¶
func (_m *MockDeploymentStore) WriteDeploymentStatus(ctx context.Context, status DeploymentStatus) error
WriteDeploymentStatus provides a mock function with given fields: ctx, status
type MockRepositoryTeamStore ¶
MockRepositoryTeamStore is an autogenerated mock type for the RepositoryTeamStore type
func NewMockRepositoryTeamStore ¶
func NewMockRepositoryTeamStore(t interface { mock.TestingT Cleanup(func()) }) *MockRepositoryTeamStore
NewMockRepositoryTeamStore creates a new instance of MockRepositoryTeamStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockRepositoryTeamStore) ReadRepositoryTeams ¶
func (_m *MockRepositoryTeamStore) ReadRepositoryTeams(ctx context.Context, repository string) ([]string, error)
ReadRepositoryTeams provides a mock function with given fields: ctx, repository
func (*MockRepositoryTeamStore) WriteRepositoryTeams ¶
func (_m *MockRepositoryTeamStore) WriteRepositoryTeams(ctx context.Context, repository string, teams []string) error
WriteRepositoryTeams provides a mock function with given fields: ctx, repository, teams