Documentation ¶
Index ¶
- type Store
- func (db *Store) Artifact(id string) (*model.Event, error)
- func (db *Store) Artifacts(repo, branch string, gitEvent *dx.GitEvent, sourceBranch string, sha []string, ...) ([]*model.Event, error)
- func (db *Store) CreateEvent(event *model.Event) (*model.Event, error)
- func (db *Store) CreateUser(user *model.User) error
- func (db *Store) DeleteUser(login string) error
- func (db *Store) Event(id string) (*model.Event, error)
- func (db *Store) GitopsCommit(sha string) (*model.GitopsCommit, error)
- func (db *Store) KeyValue(key string) (*model.KeyValue, error)
- func (db *Store) ReposWithCleanupPolicy() ([]string, error)
- func (db *Store) SaveKeyValue(setting *model.KeyValue) error
- func (db *Store) SaveOrUpdateGitopsCommit(gitopsCommit *model.GitopsCommit) error
- func (db *Store) SaveReposWithCleanupPolicy(reposWithCleanupPolicy []string) error
- func (db *Store) UnprocessedEvents() (events []*model.Event, err error)
- func (db *Store) UpdateEventStatus(id string, status string, desc string, gitopsStatusString string) error
- func (db *Store) User(login string) (*model.User, error)
- func (db *Store) Users() ([]*model.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
Store is used to access data from the sql/database driver with a relational database backend.
func New ¶
New creates a database connection for the given driver and datasource and returns a new Store.
func NewTest ¶
func NewTest() *Store
NewTest creates a new database connection for testing purposes. The database driver and connection string are provided by environment variables, with fallback to in-memory sqlite.
func (*Store) Artifacts ¶
func (db *Store) Artifacts( repo, branch string, gitEvent *dx.GitEvent, sourceBranch string, sha []string, limit, offset int, since, until *time.Time) ([]*model.Event, error)
Artifacts returns all events in the database within the given constraints
func (*Store) CreateEvent ¶
CreateEvent stores a new event in the database
func (*Store) CreateUser ¶
CreateUser stores a new user in the database
func (*Store) DeleteUser ¶
DeleteUser deletes a user in the database
func (*Store) GitopsCommit ¶ added in v0.4.0
func (db *Store) GitopsCommit(sha string) (*model.GitopsCommit, error)
func (*Store) ReposWithCleanupPolicy ¶ added in v0.5.0
func (*Store) SaveKeyValue ¶ added in v0.5.0
SaveKeyValue sets a setting
func (*Store) SaveOrUpdateGitopsCommit ¶ added in v0.4.0
func (db *Store) SaveOrUpdateGitopsCommit(gitopsCommit *model.GitopsCommit) error
func (*Store) SaveReposWithCleanupPolicy ¶ added in v0.5.0
func (*Store) UnprocessedEvents ¶
UnprocessedEvents selects an event timeline
func (*Store) UpdateEventStatus ¶
func (db *Store) UpdateEventStatus(id string, status string, desc string, gitopsStatusString string) error
UpdateEventStatus updates an event status in the database