installer

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Installer

type Installer interface {
	Install(string) error
}

type InstallerMock

type InstallerMock struct {
	// InstallFunc mocks the Install method.
	InstallFunc func(s string) error
	// contains filtered or unexported fields
}

InstallerMock is a mock implementation of Installer.

func TestSomethingThatUsesInstaller(t *testing.T) {

	// make and configure a mocked Installer
	mockedInstaller := &InstallerMock{
		InstallFunc: func(s string) error {
			panic("mock out the Install method")
		},
	}

	// use mockedInstaller in code that requires Installer
	// and then make assertions.

}

func (*InstallerMock) Install

func (mock *InstallerMock) Install(s string) error

Install calls InstallFunc.

func (*InstallerMock) InstallCalls

func (mock *InstallerMock) InstallCalls() []struct {
	S string
}

InstallCalls gets all the calls that were made to Install. Check the length with:

len(mockedInstaller.InstallCalls())

type Option

type Option func(*ToolkitInstaller)

func WithArtifactRoot

func WithArtifactRoot(artifactRoot *artifactRoot) Option

func WithDefaultRuntimeExecutablePath

func WithDefaultRuntimeExecutablePath(path string) Option

func WithIgnoreErrors

func WithIgnoreErrors(ignoreErrors bool) Option

func WithLogger

func WithLogger(logger logger.Interface) Option

func WithSourceRoot

func WithSourceRoot(sourceRoot string) Option

WithSourceRoot sets the root directory for locating artifacts to be installed.

type ToolkitInstaller

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

func New

func New(opts ...Option) (*ToolkitInstaller, error)

New creates a toolkit installer with the specified options.

func (*ToolkitInstaller) ConfigFilePath

func (t *ToolkitInstaller) ConfigFilePath(destDir string) string

func (*ToolkitInstaller) Install

func (t *ToolkitInstaller) Install(destDir string) error

Install ensures that the required toolkit files are installed in the specified directory.

Jump to

Keyboard shortcuts

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