Documentation ¶
Index ¶
- Variables
- type Build
- type Client
- type Commit
- type CommitService
- func (s *CommitService) Get(host, owner, name, branch, sha string) (*Commit, error)
- func (s *CommitService) GetOutput(host, owner, name, branch, sha, build_number string) (io.ReadCloser, error)
- func (s *CommitService) GetOutputStream(owner, name, build_number string) (io.ReadCloser, error)
- func (s *CommitService) List(host, owner, name string) ([]*Commit, error)
- func (s *CommitService) ListBranch(host, owner, name, branch string) ([]*Commit, error)
- func (s *CommitService) Rebuild(host, owner, name, branch, sha, build_number string) error
- type Repo
- type RepoService
- func (s *RepoService) Create(owner, name string) (*Repo, error)
- func (s *RepoService) Delete(host, owner, name string) error
- func (s *RepoService) Disable(host, owner, name string) error
- func (s *RepoService) Enable(host, owner, name string) (*Repo, error)
- func (s *RepoService) EnableWithActivate(host, owner, name string, activate bool) (*Repo, error)
- func (s *RepoService) EncryptSecrets(owner string, name string, params *Secrets) (*string, error)
- func (s *RepoService) Get(host, owner, name string) (*Repo, error)
- func (s *RepoService) List() ([]*Repo, error)
- func (s *RepoService) SetKey(host, owner, name, pub, priv string) error
- func (s *RepoService) SetParams(host, owner, name, params interface{}) error
- func (s *RepoService) Update(repo *Repo) (*Repo, error)
- type Secrets
- type User
- type UserService
- func (s *UserService) Create(remote, login string, in interface{}) (*User, error)
- func (s *UserService) Delete(remote, login string) error
- func (s *UserService) Get(login string) (*User, error)
- func (s *UserService) GetCurrent() (*User, error)
- func (s *UserService) List() ([]*User, error)
- func (s *UserService) Patch(login string, in interface{}) (*User, error)
- func (s *UserService) Sync() error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { Number int `json:"number"` Event string `json:"event"` Status string `json:"status"` Enqueued int64 `json:"enqueued_at"` Created int64 `json:"created_at"` Started int64 `json:"started_at"` Finished int64 `json:"finished_at"` Commit string `json:"commit"` Branch string `json:"branch"` Ref string `json:"ref"` Refspec string `json:"refspec"` Remote string `json:"remote"` Title string `json:"title"` Message string `json:"message"` Timestamp int64 `json:"timestamp"` Author string `json:"author"` Avatar string `json:"author_avatar"` Email string `json:"author_email"` Link string `json:"link_url"` }
type Client ¶
type Client struct { Commits *CommitService Repos *RepoService Users *UserService HttpClient *http.Client // contains filtered or unexported fields }
type Commit ¶
type Commit struct { ID int64 `json:"id"` Status string `json:"status"` Started int64 `json:"started_at"` Finished int64 `json:"finished_at"` Duration int64 `json:"duration"` Sha string `json:"sha"` Branch string `json:"branch"` PullRequest string `json:"pull_request"` Author string `json:"author"` Gravatar string `json:"gravatar"` Timestamp string `json:"timestamp"` Message string `json:"message"` Created int64 `json:"created_at"` Updated int64 `json:"updated_at"` }
type CommitService ¶
type CommitService struct {
*Client
}
func (*CommitService) Get ¶
func (s *CommitService) Get(host, owner, name, branch, sha string) (*Commit, error)
GET /api/repos/{host}/{owner}/{name}/branch/{branch}/commit/{commit}
func (*CommitService) GetOutput ¶
func (s *CommitService) GetOutput(host, owner, name, branch, sha, build_number string) (io.ReadCloser, error)
GET /api/repos/{host}/{owner}/{name}/branches/{branch}/commits/{commit}/console
func (*CommitService) GetOutputStream ¶
func (s *CommitService) GetOutputStream(owner, name, build_number string) (io.ReadCloser, error)
GET /api/stream/{owner}/{name}/{build}/1
func (*CommitService) List ¶
func (s *CommitService) List(host, owner, name string) ([]*Commit, error)
GET /api/repos/{host}/{owner}/{name}/commits
func (*CommitService) ListBranch ¶
func (s *CommitService) ListBranch(host, owner, name, branch string) ([]*Commit, error)
GET /api/repos/{host}/{owner}/{name}/branch/{branch}
func (*CommitService) Rebuild ¶
func (s *CommitService) Rebuild(host, owner, name, branch, sha, build_number string) error
POST /api/repos/{host}/{owner}/{name}/branches/{branch}/commits/{commit}?action=rebuild POST /api/repos/{owner}/{name}/builds/{build_number}
type Repo ¶
type Repo struct { Remote string `json:"remote"` Host string `json:"host"` Owner string `json:"owner"` Name string `json:"name"` URL string `json:"url"` CloneURL string `json:"clone_url"` GitURL string `json:"git_url"` SSHURL string `json:"ssh_url"` LinkUrl string `json:"link_url"` Active bool `json:"active"` Private bool `json:"private"` Privileged bool `json:"privileged"` PostCommit bool `json:"post_commits"` PullRequest bool `json:"pull_requests"` PublicKey string `json:"public_key"` PrivateKey string `json:"private_key"` Timeout int64 `json:"timeout"` Created int64 `json:"created_at"` Updated int64 `json:"updated_at"` HookToken string `json:"hook_token"` }
type RepoService ¶
type RepoService struct {
*Client
}
func (*RepoService) Create ¶
func (s *RepoService) Create(owner, name string) (*Repo, error)
POST /api/repos/{owner}/{name}
func (*RepoService) Delete ¶
func (s *RepoService) Delete(host, owner, name string) error
DELETE /api/repos/{host}/{owner}/{name}?remove=true
func (*RepoService) Disable ¶
func (s *RepoService) Disable(host, owner, name string) error
POST /api/repos/{host}/{owner}/{name}/deactivate
func (*RepoService) Enable ¶
func (s *RepoService) Enable(host, owner, name string) (*Repo, error)
POST /api/repos/{host}/{owner}/{name}
func (*RepoService) EnableWithActivate ¶
func (s *RepoService) EnableWithActivate(host, owner, name string, activate bool) (*Repo, error)
func (*RepoService) EncryptSecrets ¶
func (*RepoService) Get ¶
func (s *RepoService) Get(host, owner, name string) (*Repo, error)
GET /api/repos/{host}/{owner}/{name}
func (*RepoService) SetKey ¶
func (s *RepoService) SetKey(host, owner, name, pub, priv string) error
PUT /api/repos/{host}/{owner}/{name}
func (*RepoService) SetParams ¶
func (s *RepoService) SetParams(host, owner, name, params interface{}) error
PUT /api/repos/{host}/{owner}/{name}
type User ¶
type User struct { ID int64 `json:"-"` Remote string `json:"remote"` Login string `json:"login"` Name string `json:"name"` Email string `json:"email,omitempty"` Gravatar string `json:"gravatar"` Admin bool `json:"admin"` Active bool `json:"active"` Syncing bool `json:"syncing"` Created int64 `json:"created_at"` Updated int64 `json:"updated_at"` Token string `json:"token"` }
type UserService ¶
type UserService struct {
*Client
}
func (*UserService) Create ¶
func (s *UserService) Create(remote, login string, in interface{}) (*User, error)
POST /api/users/{host}/{login}
func (*UserService) Delete ¶
func (s *UserService) Delete(remote, login string) error
DELETE /api/users/{host}/{login}
func (*UserService) Get ¶
func (s *UserService) Get(login string) (*User, error)
GET /api/users/{host}/{login}