github

package module
v0.0.0-...-92fbbed Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2016 License: MIT Imports: 8 Imported by: 1

README

Github's Release Manipulator

Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CacheTTL set time to live of cached responses.
	CacheTTL = time.Minute * 5
)
View Source
var (
	DefaultClient = &Client{}
)
View Source
var (
	ErrNotModified = errors.New("not modified")
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name        string
	State       string
	Size        uint64
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	DownloadURL string    `json:"browser_download_url"`
}

Asset represents a downloadable object in release.

type Client

type Client struct {
	DisableCache bool

	Username string
	Token    string

	Logger Logger
	// contains filtered or unexported fields
}

Client packs access context/infomation to github.

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

type Release

type Release struct {
	Name        string
	Draft       bool
	PreRelease  bool      `json:"prerelease"`
	CreatedAt   time.Time `json:"created_at"`
	PublishedAt time.Time `json:"published_at"`
	Assets      []Asset
}

Release represents a release on Github.

func Latest

func Latest(owner, repo string) (*Release, error)

Latest gets latest release info.

func LatestIfModifiedSince

func LatestIfModifiedSince(owner, repo string, pivot time.Time) (*Release, error)

LatestIfModifiedSince gets latest release info if modified since pivot. If no modification, it returns ErrNotModified.

type User

type User struct {
	Login string
	ID    int64
}

User represents

func CurrentUser

func CurrentUser() (*User, error)

CurrentUser obtains current login user.

Jump to

Keyboard shortcuts

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