github

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Config

type Config struct {
	Token string
}

type GitHub

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

func New

func New(config Config) (*GitHub, error)

func (*GitHub) GetFilesByBranch

func (g *GitHub) GetFilesByBranch(ctx context.Context, owner, name, branch string) (Store, error)

func (*GitHub) GetFilesByTag

func (g *GitHub) GetFilesByTag(ctx context.Context, owner, name, tag string) (Store, error)

func (*GitHub) GetLatestTag

func (g *GitHub) GetLatestTag(ctx context.Context, owner, name, major string) (string, error)

type Store

type Store interface {
	// ReadFile is similar to io/ioutil.ReadFile but it returns error
	// matched by IsNotFound if the file does not exist.
	ReadFile(path string) ([]byte, error)
	// ReadDir is similar to io/ioutil.ReadDir but it returns error matched
	// by IsNotFound if the directory does not exist.
	ReadDir(dirname string) ([]os.FileInfo, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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