hub

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 FileTokenManager added in v0.1.17

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

func (*FileTokenManager) DeleteGithubToken added in v0.1.17

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

func (*FileTokenManager) GetGithubToken added in v0.1.17

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

func (*FileTokenManager) SetGithubToken added in v0.1.17

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

type MemoryTokenManager added in v0.1.10

type MemoryTokenManager struct {
	// 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 NewFile added in v0.1.17

func NewFile(file string) (TokenManager, error)

func NewFileForHost added in v0.1.17

func NewFileForHost(host string) (TokenManager, error)

func NewMemory added in v0.1.10

func NewMemory(s string) (TokenManager, error)

Jump to

Keyboard shortcuts

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