Documentation ¶
Index ¶
- type Store
- func (db *Store) Commits(repo string) ([]*model.Commit, error)
- func (db *Store) CommitsByRepoAndSHA(repo string, hashes []string) ([]*model.Commit, error)
- func (db *Store) CreateCommit(commit *model.Commit) error
- func (db *Store) CreateUser(user *model.User) error
- func (db *Store) KeyValue(key string) (*model.KeyValue, error)
- func (db *Store) SaveCommits(repo string, commits []*model.Commit) error
- func (db *Store) SaveKeyValue(setting *model.KeyValue) error
- func (db *Store) SaveStatusesOnCommits(repo string, statuses map[string]*model.CombinedStatus) error
- func (db *Store) SaveTagsOnCommits(repo string, tags map[string][]string) error
- func (db *Store) UpdateUser(user *model.User) error
- func (db *Store) User(login string) (*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) CommitsByRepoAndSHA ¶
func (*Store) CreateCommit ¶
CreateCommit stores a new commit in the database
func (*Store) CreateUser ¶
CreateUser stores a new user in the database
func (*Store) SaveCommits ¶
SaveCommits stores new commits in the database, or updates them
func (*Store) SaveKeyValue ¶ added in v0.3.0
SaveKeyValue sets a setting
func (*Store) SaveStatusesOnCommits ¶
func (db *Store) SaveStatusesOnCommits(repo string, statuses map[string]*model.CombinedStatus) error
SaveStatusesOnCommits updates statuses on commits
func (*Store) SaveTagsOnCommits ¶
SaveTagsOnCommits updates tags on commits
func (*Store) UpdateUser ¶
UpdateUser updates a user in the database