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) UnprocessedEvents() (events []*model.Event, err error)
- func (db *Store) UpdateEventStatus(id string, status string, desc 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) UnprocessedEvents ¶
UnprocessedEvents selects an event timeline
func (*Store) UpdateEventStatus ¶
UpdateEventStatus updates an event status in the database