spin

package
v0.0.0-...-ccaee0b Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name  string
	Steps []Step // using UnmarshalYAML so that we don't need a custom type per action
}

func (Action) GetSteps

func (a Action) GetSteps() []builder.ExecutableStep

func (Action) MakeSteps

func (a Action) MakeSteps() interface{}

MakeSteps builds a slice of Step for data to be unmarshaled into.

func (Action) MarshalYAML

func (a Action) MarshalYAML() (interface{}, error)

MarshalYAML converts the action back to a YAML representation install:

spin:
  ...

func (*Action) UnmarshalYAML

func (a *Action) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML takes any yaml in this form ACTION: - spin: ... and puts the steps into the Action.Steps field

type Actions

type Actions []Action

Actions is a set of actions, and the steps, passed from Porter.

func (*Actions) UnmarshalYAML

func (a *Actions) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML takes chunks of a porter.yaml file associated with this mixin and populates it on the current action set. install:

spin:
  ...
spin:
  ...

upgrade:

spin:
  ...

type BuildInput

type BuildInput struct {
	Config *MixinConfig
}

BuildInput represents stdin passed to the mixin for the build command.

type Instruction

type Instruction struct {
	Name           string        `yaml:"name"`
	Description    string        `yaml:"description"`
	Arguments      []string      `yaml:"arguments,omitempty"`
	Outputs        []Output      `yaml:"outputs,omitempty"`
	SuppressOutput bool          `yaml:"suppress-output,omitempty"`
	Flags          builder.Flags `yaml:"flags,omitempty"`
	WorkingDir     string        `yaml:"workingDir, omitempty"`

	// Allow the user to ignore some errors
	// Adds the ignoreError functionality from the exec mixin
	// https://release-v1.porter.sh/mixins/exec/#ignore-error
	builder.IgnoreErrorHandler `yaml:"ignoreError,omitempty"`
	SpinFields                 `yaml:",inline"`
}

func (Instruction) GetCommand

func (s Instruction) GetCommand() string

func (Instruction) GetOutputs

func (s Instruction) GetOutputs() []builder.Output

type Mixin

type Mixin struct {
	runtime.RuntimeConfig
	ClientVersion string
	// contains filtered or unexported fields
}

func New

func New() *Mixin

func (*Mixin) Build

func (m *Mixin) Build(ctx context.Context) error

func (*Mixin) Execute

func (m *Mixin) Execute(ctx context.Context) error

used by uninstall & upgrade for rn

func (*Mixin) Init

func (m *Mixin) Init(ctx context.Context) error

func (*Mixin) Install

func (m *Mixin) Install(ctx context.Context) error

Install runs a spin deploy

func (*Mixin) PrintSchema

func (m *Mixin) PrintSchema()

func (*Mixin) PrintVersion

func (m *Mixin) PrintVersion(opts version.Options) error

func (*Mixin) Uninstall

func (m *Mixin) Uninstall(ctx context.Context) error

Uninstall runs a Spin destroy

func (*Mixin) Upgrade

func (m *Mixin) Upgrade(ctx context.Context) error

Upgrade runs a Spin destroy

type MixinConfig

type MixinConfig struct {
	ClientVersion string `yaml:"clientVersion,omitempty"`
	FermyonCloud  bool   `yaml:"fermyonCloud"`
	WorkingDir    string `yaml:"workingDir, omitempty"`
}

type Output

type Output struct {
	Name string `yaml:"name"`

	// See https://porter.sh/mixins/exec/#outputs
	// TODO: If your mixin doesn't support these output types, you can remove these and the interface assertions above, and from #/definitions/outputs in schema.json
	JsonPath string `yaml:"jsonPath,omitempty"`
	FilePath string `yaml:"path,omitempty"`
	Regex    string `yaml:"regex,omitempty"`
}

func (Output) GetFilePath

func (o Output) GetFilePath() string

func (Output) GetJsonPath

func (o Output) GetJsonPath() string

func (Output) GetName

func (o Output) GetName() string

func (Output) GetRegex

func (o Output) GetRegex() string

type SpinFields

type SpinFields struct {
	FermyonCloud   bool   `yaml:"fermyonCloud"`
	PlatformURL    string `yaml:"platformURL"`
	HippoUsername  string `yaml:"hippoUsername"`
	HippoPassword  string `yaml:"hippoPassword"`
	Insecure       bool   `yaml:"insecure"`
	BindleUsername string `yaml:"bindleUsername"`
	BindleServer   string `yaml:"bindleServer"`
	BindlePassword string `yaml:"bindlePassword"`
}

type Step

type Step struct {
	Instruction `yaml:"spin"`
}

func (Step) GetArguments

func (s Step) GetArguments() []string

func (Step) GetFlags

func (s Step) GetFlags() builder.Flags

func (Step) GetWorkingDir

func (s Step) GetWorkingDir() string

type TestMixin

type TestMixin struct {
	*Mixin
	TestContext *portercontext.TestContext
}

func NewTestMixin

func NewTestMixin(t *testing.T) *TestMixin

NewTestMixin initializes a mixin test client, with the output buffered, and an in-memory file system.

Jump to

Keyboard shortcuts

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