github

package
v0.0.0-...-cf3502d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: MIT Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitFile

type CommitFile struct {
	Path    string `json:"-"`
	Message string `json:"message"`
	Content string `json:"content"`
	Branch  string `json:"branch"` // optional, default master
}

func NewCommitFile

func NewCommitFile(path string, message, content, branch string) *CommitFile

type ErrReturn

type ErrReturn struct {
	Message     string `json:"message"`
	StatusCode  int    `json:"-"`
	DocumentURL string `json:"documentation_url"`
}

func (*ErrReturn) Error

func (e *ErrReturn) Error() string

type FileContent

type FileContent struct {
	Type        string `json:"type"`
	Sha         string `json:"sha"`
	Name        string `json:"name"`
	Path        string `json:"path"`
	Size        uint64 `json:"size"`
	Encoding    string `json:"encoding"`
	DownloadURL string `json:"download_url"`
}

type Github

type Github struct {
	// contains filtered or unexported fields
}

func New

func New(token string) *Github

func (*Github) GetFile

func (t *Github) GetFile(owner, repo string, path string) (*FileContent, error)

func (*Github) Hooks

func (t *Github) Hooks(owner, repo string) (hooks []*Hook, err error)

func (*Github) Repositories

func (t *Github) Repositories() (repos []*Repository, err error)

func (*Github) UpdateFile

func (t *Github) UpdateFile(owner, repo string, file *CommitFile) error

func (*Github) User

func (t *Github) User() (user *User, err error)

type Hook

type Hook struct {
	Id     int      `json:"id"`
	Name   string   `json:"name"`
	Active bool     `json:"active"`
	Events []string `json:"events"`
	Url    string   `json:"url"`
	Config struct {
		Url         string `json:"url"`
		ContentType string `json:"content_type"`
	} `json:"config"`
}

https://developer.github.com/v3/repos/hooks/#list-hooks

func (*Hook) String

func (h *Hook) String() string

type Repository

type Repository struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Fullname string `json:"full_name"`
	Private  bool   `json:"private"`
	Fork     bool   `json:"fork"`
	HtmlURL  string `json:"html_url"`
}

type User

type User struct {
	Login   string `json:"login"`
	Name    string `json:"name"`
	Email   string `json:"email"`
	Company string `json:"company"`
}

Jump to

Keyboard shortcuts

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