database

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBuild

func DeleteBuild(id int64) error

Deletes an existing Build.

func DeleteCommit

func DeleteCommit(id int64) error

Deletes an existing Commit.

func DeleteMember

func DeleteMember(user, team int64) error

Deletes an existing Member.

func DeleteRepo

func DeleteRepo(id int64) error

Deletes an existing Repository. TODO need to delete builds too.

func DeleteTeam

func DeleteTeam(id int64) error

Deletes an existing Team account.

func DeleteUser

func DeleteUser(id int64) error

Deletes an existing User account.

func GetBranch

func GetBranch(repo int64, branch string) (*Commit, error)

Returns the most recent Commit for the given branch.

func GetBuild

func GetBuild(id int64) (*Build, error)

Returns the Build with the given ID.

func GetBuildSlug

func GetBuildSlug(slug string, commit int64) (*Build, error)

Returns the Build with the given slug.

func GetCommit

func GetCommit(id int64) (*Commit, error)

Returns the Commit with the given ID.

func GetCommitHash

func GetCommitHash(hash string, repo int64) (*Commit, error)

Returns the Commit with the given hash.

func GetMember

func GetMember(user, team int64) (*Member, error)

Returns the Member with the given user and team IDs.

func GetPassEmail

func GetPassEmail(email string) ([]byte, error)

Returns the User Password Hash for the given email address.

func GetRepo

func GetRepo(id int64) (*Repo, error)

Returns the Repo with the given ID.

func GetRepoSlug

func GetRepoSlug(slug string) (*Repo, error)

Returns the Repo with the given slug.

func GetSettings

func GetSettings() (*Settings, error)

Returns the system Settings.

func GetTeam

func GetTeam(id int64) (*Team, error)

Returns the Team with the given ID.

func GetTeamSlug

func GetTeamSlug(slug string) (*Team, error)

Returns the Team with the given slug.

func GetUser

func GetUser(id int64) (*User, error)

Returns the User with the given ID.

func GetUserEmail

func GetUserEmail(email string) (*User, error)

Returns the User with the given email address.

func IsMember

func IsMember(user, team int64) (bool, error)

Returns true if the user is a member of the team

func IsMemberAdmin

func IsMemberAdmin(user, team int64) (bool, error)

Returns true is the user is an admin member of the team.

func ListBranches

func ListBranches(repo int64) ([]*Commit, error)

Returns a list of the most recent commits for each branch.

func ListBuilds

func ListBuilds(id int64) ([]*Build, error)

Returns a list of all Builds associated with the specified Commit ID and branch.

func ListCommits

func ListCommits(repo int64, branch string) ([]*Commit, error)

Returns a list of all Commits associated with the specified Repo ID.

func ListCommitsTeam

func ListCommitsTeam(team int64) ([]*RepoCommit, error)

Returns a list of recent Commits associated with the specified Team ID

func ListCommitsUser

func ListCommitsUser(user int64) ([]*RepoCommit, error)

Returns a list of recent Commits associated with the specified User ID

func ListMembers

func ListMembers(team int64) ([]*Member, error)

Returns a list of all Team members.

func ListRepos

func ListRepos(id int64) ([]*Repo, error)

Returns a list of all Repos associated with the specified User ID.

func ListReposTeam

func ListReposTeam(id int64) ([]*Repo, error)

Returns a list of all Repos associated with the specified Team ID.

func ListTeams

func ListTeams(id int64) ([]*Team, error)

Returns a list of all Teams associated with the specified User ID.

func ListUsers

func ListUsers() ([]*User, error)

Returns a list of all Users.

func ListUsersRange

func ListUsersRange(limit, offset int) ([]*User, error)

Returns a list of Users within the specified range (for pagination purposes).

func SaveBuild

func SaveBuild(build *Build) error

Creates a new Build.

func SaveCommit

func SaveCommit(commit *Commit) error

Creates a new Commit.

func SaveMember

func SaveMember(user, team int64, role string) error

Creates a new Member.

func SaveRepo

func SaveRepo(repo *Repo) error

Creates a new Repository.

func SaveSettings

func SaveSettings(settings *Settings) error

Saves the system Settings.

func SaveTeam

func SaveTeam(team *Team) error

Saves a Team.

func SaveUser

func SaveUser(user *User) error

Saves the User account.

func Set

func Set(database *sql.DB)

Set sets the default database.

func SettingsMust

func SettingsMust() *Settings

Returns the system Settings. This is expected always pass, and will panic on failure.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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