Documentation ¶
Index ¶
- func Connect(driver, datasource string) (*sql.DB, error)
- func MustConnect(driver, datasource string) *sql.DB
- func NewDatastore(db *sql.DB) datastore.Datastore
- type Blob
- type Blobstore
- type Commitstore
- func (db *Commitstore) DelCommit(commit *model.Commit) error
- func (db *Commitstore) GetBuildNumber(commit *model.Commit) (int64, error)
- func (db *Commitstore) GetCommit(id int64) (*model.Commit, error)
- func (db *Commitstore) GetCommitLast(repo *model.Repo, branch string) (*model.Commit, error)
- func (db *Commitstore) GetCommitList(repo *model.Repo, limit, offset int) ([]*model.Commit, error)
- func (db *Commitstore) GetCommitListActivity(user *model.User, limit, offset int) ([]*model.CommitRepo, error)
- func (db *Commitstore) GetCommitListUser(user *model.User) ([]*model.CommitRepo, error)
- func (db *Commitstore) GetCommitPrior(oldCommit *model.Commit) (*model.Commit, error)
- func (db *Commitstore) GetCommitSha(repo *model.Repo, branch, sha string) (*model.Commit, error)
- func (db *Commitstore) KillCommits() error
- func (db *Commitstore) PostCommit(commit *model.Commit) error
- func (db *Commitstore) PutCommit(commit *model.Commit) error
- type Permstore
- type Repostore
- func (db *Repostore) DelRepo(repo *model.Repo) error
- func (db *Repostore) GetRepo(id int64) (*model.Repo, error)
- func (db *Repostore) GetRepoList(user *model.User) ([]*model.Repo, error)
- func (db *Repostore) GetRepoName(remote, owner, name string) (*model.Repo, error)
- func (db *Repostore) PostRepo(repo *model.Repo) error
- func (db *Repostore) PutRepo(repo *model.Repo) error
- type Userstore
- func (db *Userstore) DelUser(user *model.User) error
- func (db *Userstore) GetUser(id int64) (*model.User, error)
- func (db *Userstore) GetUserList() ([]*model.User, error)
- func (db *Userstore) GetUserLogin(remote, login string) (*model.User, error)
- func (db *Userstore) GetUserToken(token string) (*model.User, error)
- func (db *Userstore) PostUser(user *model.User) error
- func (db *Userstore) PutUser(user *model.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect is a helper function that establishes a new database connection and auto-generates the database schema. If the database already exists, it will perform and update as needed.
func MustConnect ¶
MustConnect is a helper function that creates a new database connection and auto-generates the database schema. An error causes a panic.
Types ¶
type Blobstore ¶
func NewBlobstore ¶
func (*Blobstore) GetReader ¶
func (db *Blobstore) GetReader(path string) (io.ReadCloser, error)
GetReader retrieves an object from the blobstore. It is the caller's responsibility to call Close on the ReadCloser when finished reading.
type Commitstore ¶
func NewCommitstore ¶
func NewCommitstore(db meddler.DB) *Commitstore
func (*Commitstore) DelCommit ¶
func (db *Commitstore) DelCommit(commit *model.Commit) error
DelCommit removes the commit from the datastore.
func (*Commitstore) GetBuildNumber ¶
func (db *Commitstore) GetBuildNumber(commit *model.Commit) (int64, error)
GetBuildNumber retrieves the build number for a commit.
func (*Commitstore) GetCommit ¶
func (db *Commitstore) GetCommit(id int64) (*model.Commit, error)
GetCommit retrieves a commit from the datastore for the given ID.
func (*Commitstore) GetCommitLast ¶
GetCommitLast retrieves the latest commit from the datastore for the specified repository and branch.
func (*Commitstore) GetCommitList ¶
GetCommitList retrieves a list of latest commits from the datastore for the specified repository.
func (*Commitstore) GetCommitListActivity ¶
func (db *Commitstore) GetCommitListActivity(user *model.User, limit, offset int) ([]*model.CommitRepo, error)
GetCommitListActivity retrieves an ungrouped list of latest commits from the datastore accessible to the specified user.
func (*Commitstore) GetCommitListUser ¶
func (db *Commitstore) GetCommitListUser(user *model.User) ([]*model.CommitRepo, error)
GetCommitListUser retrieves a list of latest commits from the datastore accessible to the specified user.
func (*Commitstore) GetCommitPrior ¶
GetCommitPrior retrieves the latest commit from the datastore for the specified repository and branch.
func (*Commitstore) GetCommitSha ¶
GetCommitSha retrieves a commit from the datastore for the specified repo and sha
func (*Commitstore) KillCommits ¶
func (db *Commitstore) KillCommits() error
KillCommits updates all pending or started commits in the datastore settings the status to killed.
func (*Commitstore) PostCommit ¶
func (db *Commitstore) PostCommit(commit *model.Commit) error
PostCommit saves a commit in the datastore.
type Permstore ¶
func NewPermstore ¶
func (*Permstore) GetPerm ¶
GetPerm retrieves the User's permission from the datastore for the given repository.
type Repostore ¶
func NewRepostore ¶
func (*Repostore) GetRepoList ¶
GetRepoList retrieves a list of all repos from the datastore accessible by the given user ID.
func (*Repostore) GetRepoName ¶
GetRepoName retrieves a repo from the datastore for the specified remote, owner and name.
type Userstore ¶
func NewUserstore ¶
func (*Userstore) GetUserList ¶
GetUserList retrieves a list of all users from the datastore that are registered in the system.
func (*Userstore) GetUserLogin ¶
GetUserLogin retrieves a user from the datastore for the specified remote and login name.
func (*Userstore) GetUserToken ¶
GetUserToken retrieves a user from the datastore with the specified token.