hub

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyringService = "gordon.kyoh86.dev"
	KeyringFileDir = "gordon"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(authContext context.Context, ev gordon.Env) (*github.Client, error)

NewClient builds GitHub Client with GitHub API token that is configured.

Types

type Client

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

func New

func New(authContext context.Context, ev gordon.Env) (*Client, error)

New builds hub.Client with GitHub API token that is configured.

func (*Client) Asset

func (c *Client) Asset(ctx context.Context, repo *gogh.Repo, assetID int64) (io.ReadCloser, error)

Asset downloads an asset. Parameters:

  • repo: Target repository.
  • assetID: Target asset ID.

func (*Client) LatestRelease

func (c *Client) LatestRelease(ctx context.Context, repo *gogh.Repo) (*github.RepositoryRelease, error)

LatestRelease gets the latest release. Parameters:

  • repo: Target repository.

func (*Client) Release

func (c *Client) Release(ctx context.Context, repo *gogh.Repo, tag string) (*github.RepositoryRelease, error)

Release gets the tagged release. Parameters:

  • repo: Target repository.
  • tag: Target tag.

type Keyring added in v0.1.10

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

func (*Keyring) DeleteGithubToken added in v0.1.10

func (m *Keyring) DeleteGithubToken(user string) error

func (*Keyring) GetGithubToken added in v0.1.10

func (m *Keyring) GetGithubToken(user string) (string, error)

func (*Keyring) SetGithubToken added in v0.1.10

func (m *Keyring) SetGithubToken(user, token string) error

type MemoryTokenManager added in v0.1.10

type MemoryTokenManager struct {
	Host string
	// contains filtered or unexported fields
}

func (*MemoryTokenManager) DeleteGithubToken added in v0.1.10

func (m *MemoryTokenManager) DeleteGithubToken(user string) error

func (*MemoryTokenManager) GetGithubToken added in v0.1.10

func (m *MemoryTokenManager) GetGithubToken(user string) (string, error)

func (*MemoryTokenManager) SetGithubToken added in v0.1.10

func (m *MemoryTokenManager) SetGithubToken(user, token string) error

type TokenManager added in v0.1.10

type TokenManager interface {
	SetGithubToken(user, token string) error
	GetGithubToken(user string) (string, error)
	DeleteGithubToken(user string) error
}

func NewKeyring added in v0.1.10

func NewKeyring(host string) (TokenManager, error)

func NewMemory added in v0.1.10

func NewMemory(host string) (TokenManager, error)

Jump to

Keyboard shortcuts

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