puller

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPuller

type MockPuller struct {
	mock.Mock
}

MockPuller is an autogenerated mock type for the Puller type

func NewMockPuller

func NewMockPuller(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPuller

NewMockPuller creates a new instance of MockPuller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPuller) EXPECT

func (_m *MockPuller) EXPECT() *MockPuller_Expecter

func (*MockPuller) Pull

Pull provides a mock function with given fields: _a0, _a1, _a2, _a3

type MockPuller_Expecter

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

func (*MockPuller_Expecter) Pull

func (_e *MockPuller_Expecter) Pull(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 ...interface{}) *MockPuller_Pull_Call

Pull is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 PullMethod
  • _a2 *artifact.Artifact
  • _a3 ...PullOption

type MockPuller_Pull_Call

type MockPuller_Pull_Call struct {
	*mock.Call
}

MockPuller_Pull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pull'

func (*MockPuller_Pull_Call) Return

func (*MockPuller_Pull_Call) Run

func (*MockPuller_Pull_Call) RunAndReturn

type PullMethod

type PullMethod int

PullMethod is the method used to pull an artifact

const (
	PullMethodUnknown PullMethod = iota
	PullMethodHelmChart
	PullMethodGithubRelease
	PullMethodHTTPArchive
	PullMethodGit
)

type PullOption

type PullOption func(*puller)

func WithGithubReleaseOptions

func WithGithubReleaseOptions(o *github.ReleaseOptions) PullOption

WithGithubReleaseOptions sets the github release options for the puller

func WithHTTPOptions

func WithHTTPOptions(o *archive.HTTPOptions) PullOption

WithHTTPOptions sets the HTTP options for the puller

func WithHelmOptions

func WithHelmOptions(o *helm.ChartOptions) PullOption

WithHelmOptions sets the helm options for the puller

func WithRepositoryOptions

func WithRepositoryOptions(o *agit.RepositoryOptions) PullOption

WithRepositoryOptions sets the repository options for the puller

type Puller

type Puller interface {
	// Pull pulls an artifact from a source to a destination
	Pull(context.Context, PullMethod, *artifact.Artifact, ...PullOption) (*artifact.PullResult, error)
}

Puller is the interface for pulling artifacts

func NewPuller

func NewPuller(opts ...PullerOption) Puller

NewPuller creates a new puller

type PullerOption

type PullerOption func(*puller)

func WithGitRepository

func WithGitRepository(r git.Repository) PullerOption

WithGitRepository sets the git repository for the puller

func WithLogger

func WithLogger(l *slog.Logger) PullerOption

WithLogger sets the logger for the puller

Jump to

Keyboard shortcuts

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