Documentation ¶
Index ¶
- func DelCommit(c context.Context, commit *model.Commit) error
- func DelPerm(c context.Context, perm *model.Perm) error
- func DelRepo(c context.Context, repo *model.Repo) error
- func DelUser(c context.Context, user *model.User) error
- func GetBuildNumber(c context.Context, commit *model.Commit) (int64, error)
- func GetCommit(c context.Context, id int64) (*model.Commit, error)
- func GetCommitLast(c context.Context, repo *model.Repo, branch string) (*model.Commit, error)
- func GetCommitList(c context.Context, repo *model.Repo, limit, offset int) ([]*model.Commit, error)
- func GetCommitListActivity(c context.Context, user *model.User, limit, offset int) ([]*model.CommitRepo, error)
- func GetCommitListUser(c context.Context, user *model.User) ([]*model.CommitRepo, error)
- func GetCommitPrior(c context.Context, commit *model.Commit) (*model.Commit, error)
- func GetCommitSha(c context.Context, repo *model.Repo, branch, sha string) (*model.Commit, error)
- func GetPerm(c context.Context, user *model.User, repo *model.Repo) (*model.Perm, error)
- func GetRepo(c context.Context, id int64) (*model.Repo, error)
- func GetRepoList(c context.Context, user *model.User) ([]*model.Repo, error)
- func GetRepoName(c context.Context, remote, owner, name string) (*model.Repo, error)
- func GetUser(c context.Context, id int64) (*model.User, error)
- func GetUserList(c context.Context) ([]*model.User, error)
- func GetUserLogin(c context.Context, remote, login string) (*model.User, error)
- func GetUserToken(c context.Context, token string) (*model.User, error)
- func KillCommits(c context.Context) error
- func NewContext(parent context.Context, ds Datastore) context.Context
- func PostCommit(c context.Context, commit *model.Commit) error
- func PostPerm(c context.Context, perm *model.Perm) error
- func PostRepo(c context.Context, repo *model.Repo) error
- func PostUser(c context.Context, user *model.User) error
- func PutCommit(c context.Context, commit *model.Commit) error
- func PutPerm(c context.Context, perm *model.Perm) error
- func PutRepo(c context.Context, repo *model.Repo) error
- func PutUser(c context.Context, user *model.User) error
- type Commitstore
- type Datastore
- type Permstore
- type Repostore
- type Userstore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBuildNumber ¶
GetBuildNumber retrieves the monotonically increaing build number from the commit's repo
func GetCommitLast ¶
GetCommitLast retrieves the latest commit from the datastore for the specified repository and branch.
func GetCommitList ¶
GetCommitList retrieves a list of latest commits from the datastore for the specified repository.
func GetCommitListActivity ¶
func GetCommitListActivity(c context.Context, 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 GetCommitListUser ¶
GetCommitListUser retrieves a list of latest commits from the datastore accessible to the specified user.
func GetCommitPrior ¶
GetCommitPrior retrieves the latest commit from the datastore for the specified repository and branch.
func GetCommitSha ¶
GetCommitSha retrieves a commit from the datastore for the specified repo and sha
func GetRepoList ¶
GetRepoList retrieves a list of all repos from the datastore accessible by the given user ID.
func GetRepoName ¶
GetRepoName retrieves a repo from the datastore for the specified remote, owner and name.
func GetUserList ¶
GetUserList retrieves a list of all users from the datastore that are registered in the system.
func GetUserLogin ¶
GetUserLogin retrieves a user from the datastore for the specified remote and login name.
func GetUserToken ¶
GetUserToken retrieves a user from the datastore with the specified token.
func KillCommits ¶
KillCommits updates all pending or started commits in the datastore settings the status to killed.
func NewContext ¶
NewContext returns a Context whose Value method returns the application's data storage objects.
func PostCommit ¶
PostCommit saves a commit in the datastore.
Types ¶
type Commitstore ¶
type Commitstore interface { // GetCommit retrieves a commit from the // datastore for the given ID. GetCommit(id int64) (*model.Commit, error) // GetCommitSha retrieves a commit from the // datastore for the specified repo and sha GetCommitSha(repo *model.Repo, branch, sha string) (*model.Commit, error) // GetCommitLast retrieves the latest commit // from the datastore for the specified repository // and branch. GetCommitLast(repo *model.Repo, branch string) (*model.Commit, error) // GetCommitList retrieves a list of latest commits // from the datastore for the specified repository. GetCommitList(repo *model.Repo, limit, offset int) ([]*model.Commit, error) // GetCommitListUser retrieves a list of latest commits // from the datastore accessible to the specified user. GetCommitListUser(user *model.User) ([]*model.CommitRepo, error) // GetCommitListActivity retrieves an ungrouped list of latest commits // from the datastore accessible to the specified user. GetCommitListActivity(user *model.User, limit, offset int) ([]*model.CommitRepo, error) // GetCommitPrior retrieves the latest commit // from the datastore for the specified repository and branch. GetCommitPrior(commit *model.Commit) (*model.Commit, error) // PostCommit saves a commit in the datastore. PostCommit(commit *model.Commit) error // PutCommit saves a commit in the datastore. PutCommit(commit *model.Commit) error // DelCommit removes the commit from the datastore. DelCommit(commit *model.Commit) error // KillCommits updates all pending or started commits // in the datastore settings the status to killed. KillCommits() error // GetCommitBuildNumber retrieves the monotonically increaing build number // from the commit's repo GetBuildNumber(commit *model.Commit) (int64, error) }
type Datastore ¶
type Datastore interface { Userstore Permstore Repostore Commitstore }
func FromContext ¶
FromContext returns the sql.DB associated with this context.
type Permstore ¶
type Permstore interface { // GetPerm retrieves the User's permission from // the datastore for the given repository. GetPerm(user *model.User, repo *model.Repo) (*model.Perm, error) // PostPerm saves permission in the datastore. PostPerm(perm *model.Perm) error // PutPerm saves permission in the datastore. PutPerm(perm *model.Perm) error // DelPerm removes permission from the datastore. DelPerm(perm *model.Perm) error }
type Repostore ¶
type Repostore interface { // GetRepo retrieves a specific repo from the // datastore for the given ID. GetRepo(id int64) (*model.Repo, error) // GetRepoName retrieves a repo from the datastore // for the specified remote, owner and name. GetRepoName(remote, owner, name string) (*model.Repo, error) // GetRepoList retrieves a list of all repos from // the datastore accessible by the given user ID. GetRepoList(user *model.User) ([]*model.Repo, error) // PostRepo saves a repo in the datastore. PostRepo(repo *model.Repo) error // PutRepo saves a repo in the datastore. PutRepo(repo *model.Repo) error // DelRepo removes the repo from the datastore. DelRepo(repo *model.Repo) error }
type Userstore ¶
type Userstore interface { // GetUser retrieves a specific user from the // datastore for the given ID. GetUser(id int64) (*model.User, error) // GetUserLogin retrieves a user from the datastore // for the specified remote and login name. GetUserLogin(remote, login string) (*model.User, error) // GetUserToken retrieves a user from the datastore // with the specified token. GetUserToken(token string) (*model.User, error) // GetUserList retrieves a list of all users from // the datastore that are registered in the system. GetUserList() ([]*model.User, error) // PostUser saves a User in the datastore. PostUser(user *model.User) error // PutUser saves a user in the datastore. PutUser(user *model.User) error // DelUser removes the user from the datastore. DelUser(user *model.User) error }