mock

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheClientMock

type CacheClientMock struct {
	SetFn  func(key string, value interface{}, exp time.Duration) error
	GetFn  func(key string) (string, error)
	DelFn  func(key string) error
	ScanFn func(key string, action func(context.Context, string) error) error
}

CacheClientMock is a mock of CacheClient

func (CacheClientMock) Del

func (c CacheClientMock) Del(key string) error

Del calls DelFn

func (CacheClientMock) Get

func (c CacheClientMock) Get(key string) (string, error)

Get calls GetFn

func (CacheClientMock) Scan

func (c CacheClientMock) Scan(key string, action func(context.Context, string) error) error

Scan calls ScanFn

func (CacheClientMock) Set

func (c CacheClientMock) Set(key string, value interface{}, exp time.Duration) error

Set calls SetFn

type ProviderMock

type ProviderMock struct {
	GetContentToPublishFn func() (*domain.Content, error)
}

ProviderMock is a mock Provider

func (ProviderMock) GetContentToPublish

func (p ProviderMock) GetContentToPublish() (*domain.Content, error)

GetContentToPublish calls the GetContentToPublishFn

type PublisherMock

type PublisherMock struct {
	PublishContentFn func(content *domain.Content) (bool, error)
}

PublisherMock is a mock Publisher

func (PublisherMock) PublishContent

func (p PublisherMock) PublishContent(content *domain.Content) (bool, error)

PublishContent calls the PublishContentFn

type RepoClientMock

type RepoClientMock struct {
	GetContentsFn func(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error)
	UpdateFileFn  func(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *github.Response, error)
}

func (RepoClientMock) GetContents

func (rcm RepoClientMock) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error)

func (RepoClientMock) UpdateFile

type SearchClientMock

type SearchClientMock struct {
	RepositoriesFn func(ctx context.Context, query string, opt *github.SearchOptions) (*github.RepositoriesSearchResult, *github.Response, error)
}

SearchClientMock is the mock for the search client from Github provider

func (SearchClientMock) Repositories

Repositories calls RepositoriesFn

type UserClientMock

type UserClientMock struct {
	GetFn func(ctx context.Context, user string) (*github.User, *github.Response, error)
}

UserClientMock is the mock for the user client from Github provider

func (UserClientMock) Get

func (ucm UserClientMock) Get(ctx context.Context, user string) (*github.User, *github.Response, error)

Get calls GetFn

Jump to

Keyboard shortcuts

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