store

package
v0.5.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2017 License: Apache-2.0 Imports: 3 Imported by: 544

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAgent added in v0.5.0

func CreateAgent(c context.Context, agent *model.Agent) error

func CreateBuild

func CreateBuild(c context.Context, build *model.Build, jobs ...*model.Job) error

func CreateJob

func CreateJob(c context.Context, job *model.Job) error

func CreateRepo

func CreateRepo(c context.Context, repo *model.Repo) error

func CreateUser

func CreateUser(c context.Context, user *model.User) error

func DeleteAgent added in v0.5.0

func DeleteAgent(c context.Context, agent *model.Agent) error

func DeleteGlobalSecret added in v0.5.0

func DeleteGlobalSecret(c context.Context, s *model.TeamSecret) error

func DeleteRepo

func DeleteRepo(c context.Context, repo *model.Repo) error

func DeleteSecret added in v0.4.2

func DeleteSecret(c context.Context, s *model.RepoSecret) error

func DeleteTeamSecret added in v0.5.0

func DeleteTeamSecret(c context.Context, s *model.TeamSecret) error

func DeleteUser

func DeleteUser(c context.Context, user *model.User) error

func GetAgent added in v0.5.0

func GetAgent(c context.Context, id int64) (*model.Agent, error)

func GetAgentAddr added in v0.5.0

func GetAgentAddr(c context.Context, addr string) (*model.Agent, error)

func GetAgentList added in v0.5.0

func GetAgentList(c context.Context) ([]*model.Agent, error)

func GetBuild

func GetBuild(c context.Context, id int64) (*model.Build, error)

func GetBuildCommit

func GetBuildCommit(c context.Context, repo *model.Repo, sha, branch string) (*model.Build, error)

func GetBuildLast

func GetBuildLast(c context.Context, repo *model.Repo, branch string) (*model.Build, error)

func GetBuildLastBefore

func GetBuildLastBefore(c context.Context, repo *model.Repo, branch string, number int64) (*model.Build, error)

func GetBuildList

func GetBuildList(c context.Context, repo *model.Repo) ([]*model.Build, error)

func GetBuildNumber

func GetBuildNumber(c context.Context, repo *model.Repo, num int) (*model.Build, error)

func GetBuildQueue added in v0.5.0

func GetBuildQueue(c context.Context) ([]*model.Feed, error)

func GetBuildRef

func GetBuildRef(c context.Context, repo *model.Repo, ref string) (*model.Build, error)

func GetGlobalSecret added in v0.5.0

func GetGlobalSecret(c context.Context, name string) (*model.TeamSecret, error)

func GetGlobalSecretList added in v0.5.0

func GetGlobalSecretList(c context.Context) ([]*model.TeamSecret, error)

func GetJob

func GetJob(c context.Context, id int64) (*model.Job, error)

func GetJobList

func GetJobList(c context.Context, build *model.Build) ([]*model.Job, error)

func GetJobNumber

func GetJobNumber(c context.Context, build *model.Build, num int) (*model.Job, error)

func GetMergedSecretList added in v0.5.0

func GetMergedSecretList(c context.Context, r *model.Repo) ([]*model.Secret, error)

func GetRepo

func GetRepo(c context.Context, id int64) (*model.Repo, error)

func GetRepoListOf

func GetRepoListOf(c context.Context, listof []*model.RepoLite) ([]*model.Repo, error)

func GetRepoName

func GetRepoName(c context.Context, name string) (*model.Repo, error)

func GetRepoOwnerName

func GetRepoOwnerName(c context.Context, owner, name string) (*model.Repo, error)

func GetSecret added in v0.4.2

func GetSecret(c context.Context, r *model.Repo, name string) (*model.RepoSecret, error)

func GetSecretList added in v0.4.2

func GetSecretList(c context.Context, r *model.Repo) ([]*model.RepoSecret, error)

func GetTeamSecret added in v0.5.0

func GetTeamSecret(c context.Context, team, name string) (*model.TeamSecret, error)

func GetTeamSecretList added in v0.5.0

func GetTeamSecretList(c context.Context, team string) ([]*model.TeamSecret, error)

func GetUser

func GetUser(c context.Context, id int64) (*model.User, error)

GetUser gets a user by unique ID.

func GetUserCount added in v0.4.2

func GetUserCount(c context.Context) (int, error)

GetUserCount gets a count of all users in the system.

func GetUserFeed

func GetUserFeed(c context.Context, listof []*model.RepoLite, latest bool) ([]*model.Feed, error)

GetUserFeed gets a user activity feed.

func GetUserList

func GetUserList(c context.Context) ([]*model.User, error)

GetUserList gets a list of all users in the system.

func GetUserLogin

func GetUserLogin(c context.Context, login string) (*model.User, error)

GetUserLogin gets a user by unique Login name.

func ReadLog

func ReadLog(c context.Context, job *model.Job) (io.ReadCloser, error)

func SetGlobalSecret added in v0.5.0

func SetGlobalSecret(c context.Context, s *model.TeamSecret) error

func SetSecret added in v0.4.2

func SetSecret(c context.Context, s *model.RepoSecret) error

func SetTeamSecret added in v0.5.0

func SetTeamSecret(c context.Context, s *model.TeamSecret) error

func ToContext

func ToContext(c Setter, store Store)

ToContext adds the Store to this context if it supports the Setter interface.

func UpdateAgent added in v0.5.0

func UpdateAgent(c context.Context, agent *model.Agent) error

func UpdateBuild

func UpdateBuild(c context.Context, build *model.Build) error

func UpdateBuildJob added in v0.4.2

func UpdateBuildJob(c context.Context, build *model.Build, job *model.Job) (bool, error)

func UpdateJob

func UpdateJob(c context.Context, job *model.Job) error

func UpdateRepo

func UpdateRepo(c context.Context, repo *model.Repo) error

func UpdateUser

func UpdateUser(c context.Context, user *model.User) error

func WriteLog

func WriteLog(c context.Context, job *model.Job, r io.Reader) error

Types

type Setter

type Setter interface {
	Set(string, interface{})
}

Setter defines a context that enables setting values.

type Store

type Store interface {
	// GetUser gets a user by unique ID.
	GetUser(int64) (*model.User, error)

	// GetUserLogin gets a user by unique Login name.
	GetUserLogin(string) (*model.User, error)

	// GetUserList gets a list of all users in the system.
	GetUserList() ([]*model.User, error)

	// GetUserFeed gets a user activity feed.
	GetUserFeed([]*model.RepoLite) ([]*model.Feed, error)

	// GetUserFeedLatest gets a user activity feed for all repositories including
	// only the latest build for each repository.
	GetUserFeedLatest(listof []*model.RepoLite) ([]*model.Feed, error)

	// GetUserCount gets a count of all users in the system.
	GetUserCount() (int, error)

	// CreateUser creates a new user account.
	CreateUser(*model.User) error

	// UpdateUser updates a user account.
	UpdateUser(*model.User) error

	// DeleteUser deletes a user account.
	DeleteUser(*model.User) error

	// GetRepo gets a repo by unique ID.
	GetRepo(int64) (*model.Repo, error)

	// GetRepoName gets a repo by its full name.
	GetRepoName(string) (*model.Repo, error)

	// GetRepoListOf gets the list of enumerated repos in the system.
	GetRepoListOf([]*model.RepoLite) ([]*model.Repo, error)

	// GetRepoCount gets a count of all repositories in the system.
	GetRepoCount() (int, error)

	// CreateRepo creates a new repository.
	CreateRepo(*model.Repo) error

	// UpdateRepo updates a user repository.
	UpdateRepo(*model.Repo) error

	// DeleteRepo deletes a user repository.
	DeleteRepo(*model.Repo) error

	// GetSecretList gets a list of repository secrets
	GetSecretList(*model.Repo) ([]*model.RepoSecret, error)

	// GetSecret gets the named repository secret.
	GetSecret(*model.Repo, string) (*model.RepoSecret, error)

	// SetSecret sets the named repository secret.
	SetSecret(*model.RepoSecret) error

	// DeleteSecret deletes the named repository secret.
	DeleteSecret(*model.RepoSecret) error

	// GetTeamSecretList gets a list of team secrets
	GetTeamSecretList(string) ([]*model.TeamSecret, error)

	// GetTeamSecret gets the named team secret.
	GetTeamSecret(string, string) (*model.TeamSecret, error)

	// SetTeamSecret sets the named team secret.
	SetTeamSecret(*model.TeamSecret) error

	// DeleteTeamSecret deletes the named team secret.
	DeleteTeamSecret(*model.TeamSecret) error

	// GetBuild gets a build by unique ID.
	GetBuild(int64) (*model.Build, error)

	// GetBuildNumber gets a build by number.
	GetBuildNumber(*model.Repo, int) (*model.Build, error)

	// GetBuildRef gets a build by its ref.
	GetBuildRef(*model.Repo, string) (*model.Build, error)

	// GetBuildCommit gets a build by its commit sha.
	GetBuildCommit(*model.Repo, string, string) (*model.Build, error)

	// GetBuildLast gets the last build for the branch.
	GetBuildLast(*model.Repo, string) (*model.Build, error)

	// GetBuildLastBefore gets the last build before build number N.
	GetBuildLastBefore(*model.Repo, string, int64) (*model.Build, error)

	// GetBuildList gets a list of builds for the repository
	GetBuildList(*model.Repo) ([]*model.Build, error)

	// GetBuildQueue gets a list of build in queue.
	GetBuildQueue() ([]*model.Feed, error)

	// CreateBuild creates a new build and jobs.
	CreateBuild(*model.Build, ...*model.Job) error

	// UpdateBuild updates a build.
	UpdateBuild(*model.Build) error

	// GetJob gets a job by unique ID.
	GetJob(int64) (*model.Job, error)

	// GetJobNumber gets a job by number.
	GetJobNumber(*model.Build, int) (*model.Job, error)

	// GetJobList gets a list of all users in the system.
	GetJobList(*model.Build) ([]*model.Job, error)

	// CreateJob creates a job.
	CreateJob(*model.Job) error

	// UpdateJob updates a job.
	UpdateJob(*model.Job) error

	// ReadLog reads the Job logs from the datastore.
	ReadLog(*model.Job) (io.ReadCloser, error)

	// WriteLog writes the job logs to the datastore.
	WriteLog(*model.Job, io.Reader) error

	GetAgent(int64) (*model.Agent, error)

	GetAgentAddr(string) (*model.Agent, error)

	GetAgentList() ([]*model.Agent, error)

	CreateAgent(*model.Agent) error

	UpdateAgent(*model.Agent) error

	DeleteAgent(*model.Agent) error
}

func FromContext

func FromContext(c context.Context) Store

FromContext returns the Store associated with this context.

Directories

Path Synopsis
ddl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL