drone

package
v0.0.0-...-022e0e5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("Not Found")
	ErrForbidden      = errors.New("Forbidden")
	ErrBadRequest     = errors.New("Bad Request")
	ErrNotAuthorized  = errors.New("Unauthorized")
	ErrInternalServer = errors.New("Internal Server Error")
)

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
}

func NewClient

func NewClient(token, url string, client *http.Client) *Client

func NewClient04

func NewClient04(token string, url string, client *http.Client) *Client

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"`
}

func (*Commit) ShaShort

func (c *Commit) ShaShort() string

Returns the Short (--short) Commit Hash.

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 (s *RepoService) EncryptSecrets(owner string, name string, params *Secrets) (*string, error)

func (*RepoService) Get

func (s *RepoService) Get(host, owner, name string) (*Repo, error)

GET /api/repos/{host}/{owner}/{name}

func (*RepoService) List

func (s *RepoService) List() ([]*Repo, error)

GET /api/user/repos

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}

func (*RepoService) Update

func (s *RepoService) Update(repo *Repo) (*Repo, error)

PUT /api/repos/{host}/{owner}/{name}

type Secrets

type Secrets struct {
	Environment []string `yaml:"environment"`
}

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}

func (*UserService) GetCurrent

func (s *UserService) GetCurrent() (*User, error)

GET /api/user

func (*UserService) List

func (s *UserService) List() ([]*User, error)

GET /api/users

func (*UserService) Patch

func (s *UserService) Patch(login string, in interface{}) (*User, error)

func (*UserService) Sync

func (s *UserService) Sync() error

POST /api/user/sync

Jump to

Keyboard shortcuts

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