service

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package service provides mock functionalities for github service.

Index

Constants

This section is empty.

Variables

View Source
var NoMockRepositoryService = MockRepositoryService()

NoMockRepositoryService is no mock RepositoryService.

Functions

This section is empty.

Types

type RepositoryService

type RepositoryService struct {
	mock.Mock
}

RepositoryService is a github.RepositoryService.

func (*RepositoryService) DownloadContents

func (r *RepositoryService) DownloadContents(
	ctx context.Context,
	owner, repo, filepath string,
	opts *github.RepositoryContentGetOptions,
) (rdr io.ReadCloser, resp *github.Response, err error)

DownloadContents satisfies github.RepositoryService.

func (*RepositoryService) DownloadReleaseAsset

func (r *RepositoryService) DownloadReleaseAsset(
	ctx context.Context,
	owner, repo string,
	id int64,
	followRedirectsClient *http.Client,
) (rdr io.ReadCloser, redirectURL string, err error)

DownloadReleaseAsset satisfies github.RepositoryService.

func (*RepositoryService) GetLatestRelease

func (r *RepositoryService) GetLatestRelease(
	ctx context.Context,
	owner, repo string,
) (release *github.RepositoryRelease, resp *github.Response, err error)

GetLatestRelease satisfies github.RepositoryService.

func (*RepositoryService) GetReleaseByTag

func (r *RepositoryService) GetReleaseByTag(
	ctx context.Context,
	owner, repo, tag string,
) (release *github.RepositoryRelease, resp *github.Response, err error)

GetReleaseByTag satisfies github.RepositoryService.

type RepositoryServiceMocker

type RepositoryServiceMocker func(tb testing.TB) *RepositoryService

RepositoryServiceMocker is RepositoryService mocker.

func MockRepositoryService

func MockRepositoryService(mocks ...func(s *RepositoryService)) RepositoryServiceMocker

MockRepositoryService creates RepositoryService mock with cleanup to ensure all the expectations are met.

Jump to

Keyboard shortcuts

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