github

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Repository RepositoryInterface
}

Client implements RepositoryInterface

func NewClient

func NewClient() Client

NewClient is the factory method to return Client for RepositoryInterface operations

func (Client) DownloadDB

func (c Client) DownloadDB(ctx context.Context, fileName string) (io.ReadCloser, int, error)

DownloadDB returns reader object of file content

type DownloadDBExpectation added in v0.4.0

type DownloadDBExpectation struct {
	Args       DownloadDBInput
	ReturnArgs DownloadDBOutput
}

type DownloadDBInput added in v0.4.0

type DownloadDBInput struct {
	FileName string
}

type DownloadDBOutput added in v0.4.0

type DownloadDBOutput struct {
	FileName string
	Size     int
	Err      error
}

type MockClient added in v0.3.0

type MockClient struct {
	mock.Mock
}

func NewMockClient added in v0.4.0

func NewMockClient(downloadDBExpectations []DownloadDBExpectation) (*MockClient, error)

func (*MockClient) DownloadDB added in v0.3.0

func (_m *MockClient) DownloadDB(ctx context.Context, fileName string) (io.ReadCloser, int, error)

type Operation added in v0.3.0

type Operation interface {
	DownloadDB(ctx context.Context, fileName string) (io.ReadCloser, int, error)
}

Operation defines the file operations

type Repository

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

Repository implements RepositoryInterface

func (Repository) DownloadAsset

func (r Repository) DownloadAsset(ctx context.Context, id int64) (io.ReadCloser, string, error)

DownloadAsset returns reader object of downloaded object

func (Repository) ListReleases

ListReleases returns all github releases on repository

type RepositoryInterface

type RepositoryInterface interface {
	ListReleases(ctx context.Context, opt *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error)
	DownloadAsset(ctx context.Context, id int64) (io.ReadCloser, string, error)
}

RepositoryInterface defines the operations on repository

Jump to

Keyboard shortcuts

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