client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 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 Client

type Client struct {
	Commits *CommitService
	Repos   *RepoService
	Users   *UserService
	// contains filtered or unexported fields
}

func New

func New(token, url string) *Client

type CommitService

type CommitService struct {
	*Client
}

func (*CommitService) Get

func (s *CommitService) Get(host, owner, name, branch, sha string) (*model.Commit, error)

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

func (*CommitService) GetOutput

func (s *CommitService) GetOutput(host, owner, name, branch, sha string) (io.ReadCloser, error)

GET /api/repos/{host}/{owner}/{name}/branches/{branch}/commits/{commit}/console

func (*CommitService) List

func (s *CommitService) List(host, owner, name string) ([]*model.Commit, error)

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

func (*CommitService) ListBranch

func (s *CommitService) ListBranch(host, owner, name, branch string) ([]*model.Commit, error)

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

func (*CommitService) Rebuild

func (s *CommitService) Rebuild(host, owner, name, branch, sha string) error

POST /api/repos/{host}/{owner}/{name}/branches/{branch}/commits/{commit}?action=rebuild

type RepoService

type RepoService struct {
	*Client
}

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) error

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

func (*RepoService) Get

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

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

func (*RepoService) List

func (s *RepoService) List() ([]*model.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) Update

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

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

type UserService

type UserService struct {
	*Client
}

func (*UserService) Create

func (s *UserService) Create(remote, login string) (*model.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(remote, login string) (*model.User, error)

GET /api/users/{host}/{login}

func (*UserService) GetCurrent

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

GET /api/user

func (*UserService) List

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

GET /api/users

Jump to

Keyboard shortcuts

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