Documentation
¶
Index ¶
- Variables
- type AuditLogDB
- type ConfigDB
- type ContributorDB
- type DeleteStatus
- type GetSuggestionsOptions
- type Interface
- type ListPolicyOptions
- type ListRoleOptions
- type ListUserOptions
- type Migrator
- type NewMigratorFunc
- type OrgPolicyDB
- type PostgresMigrator
- type ProjectsDB
- type QueryAuditLogOptions
- type RecoveryDB
- type RoleDB
- type SecretDB
- type SessionDB
- type SuggestionsDB
- type TokensDB
- type UserDB
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotFindContributor = errors.New("cannot find requested contributor")
View Source
var ErrCannotFindPolicy = errors.New("cannot find requested policy")
View Source
var ErrCannotFindProject = errors.New("cannot find requested project")
View Source
var ErrCannotFindRole = errors.New("cannot find requested role")
View Source
var ErrCannotFindSecret = errors.New("cannot find requested secret")
View Source
var ErrCannotFindSuggestion = errors.New("cannot find requested suggestion")
View Source
var ErrCannotFindUser = errors.New("cannot find requested user")
View Source
var ErrDuplicateKey = errors.New("duplicate key")
View Source
var ErrNoRows = errors.New("no rows")
Functions ¶
This section is empty.
Types ¶
type AuditLogDB ¶ added in v0.0.2
type AuditLogDB interface { Add(context.Context, auditModels.Event) error Query(context.Context, QueryAuditLogOptions) ([]auditModels.Event, error) }
type ContributorDB ¶
type ContributorDB interface { Add(context.Context, models.Label, models.Email) (*models.Contributor, error) Get(context.Context, models.Label, models.Email) (*models.Contributor, error) List(context.Context, models.Label) ([]models.Contributor, error) Delete(context.Context, models.Label, models.Email) (*models.Contributor, error) }
type DeleteStatus ¶
type DeleteStatus string
const ( DeleteStatusDeleted DeleteStatus = "deleted" DeleteStatusDoesNotExist DeleteStatus = "does_not_exist" DeleteStatusError DeleteStatus = "error" )
type GetSuggestionsOptions ¶ added in v0.0.2
type Interface ¶
type Interface interface { Roles() RoleDB Users() UserDB Projects() ProjectsDB Suggestions() SuggestionsDB Contributors() ContributorDB Config() ConfigDB Secrets() SecretDB Tokens() TokensDB Session() SessionDB Recoveries() RecoveryDB OrgPolicyDB() OrgPolicyDB AuditLog() AuditLogDB }
type ListPolicyOptions ¶
type ListRoleOptions ¶
type ListUserOptions ¶
type Migrator ¶ added in v0.0.2
Migrator represents backend/database migrations See a concrete implementation of this interface (e.g. PostgresMigrator) for more details.
func NewMigrator ¶ added in v0.0.2
NewMigrator returns a new migrator for the given db type (based off of the provided URL)
type NewMigratorFunc ¶ added in v0.0.2
NewMigratorFunc represents a constructor of a Migrator implementation
type OrgPolicyDB ¶ added in v0.0.2
type PostgresMigrator ¶ added in v0.0.2
type PostgresMigrator struct {
// contains filtered or unexported fields
}
PostgresMigrator implements the Migrator interface for a postgres backend.
type ProjectsDB ¶
type ProjectsDB interface { Get(context.Context, models.Label) (*models.Project, error) GetByID(context.Context, string) (*models.Project, error) Create(context.Context, models.Project) error Update(context.Context, models.Project) error List(context.Context) ([]models.Project, error) ListByStatus(context.Context, models.ProjectStatus) ([]models.Project, error) CreateProjectSpec(context.Context, models.Policy, SecretDB) error GetProjectSpec(context.Context, string, SecretDB) (*models.Policy, error) }
type QueryAuditLogOptions ¶ added in v0.0.2
type RecoveryDB ¶ added in v0.0.2
type RoleDB ¶
type RoleDB interface { Get(context.Context, models.Label) (*models.Role, error) GetByID(context.Context, string) (*models.Role, error) List(context.Context, *ListRoleOptions) ([]*models.Role, error) GetAll(context.Context, string) (*models.UserRoles, error) SetOrgRole(context.Context, models.Email, models.Label) (*models.Assignment, error) GetOrgRole(context.Context, models.Email) (*models.Role, error) SetProjectRole(context.Context, models.Email, models.Label, models.Label) (*models.Assignment, error) GetProjectRole(context.Context, models.Email, string) (*models.Role, error) CreateSystemRoles(context.Context) error }
type SuggestionsDB ¶ added in v0.0.2
type SuggestionsDB interface { CreateSuggestion(context.Context, models.Suggestion) error GetSuggestions(context.Context, GetSuggestionsOptions) ([]models.Suggestion, error) GetSuggestion(context.Context, string) (*models.Suggestion, error) UpdateSuggestion(context.Context, models.Suggestion) error }
type UserDB ¶
type UserDB interface { Create(context.Context, models.User) error Update(context.Context, string, models.User) error Delete(context.Context, models.Email) (DeleteStatus, error) Get(context.Context, models.Email) (*models.User, error) GetByID(context.Context, string) (*models.User, error) List(context.Context, *ListUserOptions) ([]models.User, error) }
Click to show internal directories.
Click to hide internal directories.