camel

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactSetup

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

func NewArtifactSetup

func NewArtifactSetup(artifactID artifact.ArtifactID, store *store.Store) *ArtifactSetup

func (*ArtifactSetup) EnvDef

func (as *ArtifactSetup) EnvDef(tmpDir string) (*envdef.EnvironmentDefinition, error)

func (*ArtifactSetup) Unarchiver

func (as *ArtifactSetup) Unarchiver() unarchiver.Unarchiver

type ErrMetaData

type ErrMetaData struct{ *errs.WrapperError }

type ErrNoPrefixes

type ErrNoPrefixes struct{ *locale.LocalizedError }

type ErrNotExecutable

type ErrNotExecutable struct{ *locale.LocalizedError }

type MetaData

type MetaData struct {
	// InstallDir is the root directory of the artifact files that we need to copy on the user's machine
	InstallDir string

	// AffectedEnv is an environment variable that we should ensure is not set, as it might conflict with the artifact
	AffectedEnv string `json:"affected_env"`

	// Env is a key value map containing all the env vars, values can contain the RelocationDir value (which will be replaced)
	Env map[string]string `json:"env"`

	// PathListEnv is a key value map containing all env vars, where the value is a list of paths that we have to prepend to the existing environment
	PathListEnv map[string]string `json:"path_list_env"`

	// BinaryLocations are locations that we should add to the PATH
	BinaryLocations []MetaDataBinary `json:"binaries_in"`

	// RelocationDir is the string that we should replace with the actual install dir of the artifact
	RelocationDir string `json:"relocation_dir"`

	// LibLocation is the place in which .so and .dll files are stored (which binary files will need relocated)
	RelocationTargetBinaries string `json:"relocation_target_binaries"`

	// TargetedRelocations are relocations that only target specific parts of the installation
	TargetedRelocations []TargetedRelocation `json:"custom_relocations"`
}

MetaData is used to parse the metadata.json file

func InitMetaData

func InitMetaData(rootDir string) (*MetaData, error)

InitMetaData will create an instance of MetaData based on the metadata.json file found under the given artifact install dir

func ParseMetaData

func ParseMetaData(contents []byte) (*MetaData, error)

ParseMetaData will parse the given bytes into the MetaData struct

func (*MetaData) Prepare

func (m *MetaData) Prepare(installRoot string) error

Prepare will assume the LibLocation in cases where the metadata doesn't contain it and we know what it should be

type MetaDataBinary

type MetaDataBinary struct {
	Path     string `json:"path"`
	Relative bool

	// RelativeInt is used to unmarshal the 'relative' boolean, which is given as a 0 or a 1, which Go's
	// json package doesn't recognize as bools.
	// Don't use this field, use Relative instead.
	RelativeInt int `json:"relative"`
}

MetaDataBinary is used to represent a binary path contained within the metadata.json file

type Resolver

type Resolver struct{}

func NewResolver

func NewResolver() *Resolver

func (*Resolver) ResolveArtifactName

func (r *Resolver) ResolveArtifactName(_ artifact.ArtifactID) string

type Setup

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

func NewSetup

func NewSetup(s *store.Store) *Setup

func (*Setup) DeleteOutdatedArtifacts

func (s *Setup) DeleteOutdatedArtifacts(_ artifact.ArtifactChangeset, _, alreadyInstalled store.StoredArtifactMap) error

DeleteOutdatedArtifacts deletes the entire installation directory, unless alreadyInstalled is not zero, which can happen when the executors directory needs to be re-generated.

func (*Setup) DownloadsFromBuild

func (s *Setup) DownloadsFromBuild(build model.Build, artifacts map[strfmt.UUID]artifact.Artifact) ([]artifact.ArtifactDownload, error)

func (*Setup) ResolveArtifactName

func (s *Setup) ResolveArtifactName(_ artifact.ArtifactID) string

type TargetedRelocation

type TargetedRelocation struct {
	// InDir is the directory in which files need to be relocated
	InDir string `json:"dir"`
	// SearchString to be replaced
	SearchString string `json:"search"`
	// Replacement is the replacement string
	Replacement string `json:"replace"`
}

TargetedRelocation is a relocation instruction for files in a specific directory

Jump to

Keyboard shortcuts

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