mocks

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockClient

func NewMockClient(responses map[string]*http.Response) *http.Client

NewMockClient creates a new http.Client with a MockRoundTripper.

func NewMockGitCloner

func NewMockGitCloner(dn *datanode.DataNode, err error) vcs.GitCloner

NewMockGitCloner creates a new MockGitCloner.

Types

type MockGitCloner

type MockGitCloner struct {
	DN  *datanode.DataNode
	Err error
}

MockGitCloner is a mock implementation of the GitCloner interface.

func (*MockGitCloner) CloneGitRepository

func (m *MockGitCloner) CloneGitRepository(repoURL string, progress io.Writer) (*datanode.DataNode, error)

CloneGitRepository mocks the cloning of a Git repository.

type MockRoundTripper

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

MockRoundTripper is a mock implementation of http.RoundTripper.

func (*MockRoundTripper) RoundTrip

func (m *MockRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the http.RoundTripper interface.

func (*MockRoundTripper) SetResponses

func (m *MockRoundTripper) SetResponses(responses map[string]*http.Response)

SetResponses sets the mock responses in a thread-safe way.

Jump to

Keyboard shortcuts

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