handlebars

package
v0.0.0-...-0d1d20d Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 14 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:

handlebars:
  ...

func (Action) SetDefaults

func (a Action) SetDefaults()

func (*Action) UnmarshalYAML

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

UnmarshalYAML takes any yaml in this form ACTION: - handlebars: ... 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:

handlebars:
  ...
handlebars:
  ...

upgrade:

handlebars:
  ...

type BuildInput

type BuildInput struct {
	Config MixinConfig
}

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

type Instruction

type Instruction struct {
	Template       string   `yaml:"template"`
	Data           string   `yaml:"data"`
	Destination    string   `yaml:"destination,omitempty"`
	Description    string   `yaml:"description"`
	Helpers        []string `yaml:"helpers"`
	SuppressOutput bool     `yaml:"suppress-output,omitempty"`
}

func (Instruction) GetArguments

func (s Instruction) GetArguments() []string

func (Instruction) GetCommand

func (s Instruction) GetCommand() string

hbs -s --helper /myhelpers.js --data /data.json -- /template.yaml

func (Instruction) GetFlags

func (s Instruction) GetFlags() builder.Flags

func (Instruction) GetSuffixArguments

func (s Instruction) GetSuffixArguments() []string

func (*Instruction) SetDefaults

func (s *Instruction) SetDefaults()

func (Instruction) SuppressesOutput

func (s Instruction) SuppressesOutput() bool

type Mixin

type Mixin struct {
	*context.Context
}

func New

func New() (*Mixin, error)

New mixin client.

func (*Mixin) Build

func (m *Mixin) Build() error

Build will generate the necessary Dockerfile lines for an invocation image using this mixin

func (*Mixin) Execute

func (m *Mixin) Execute() error

func (*Mixin) GetSchema

func (m *Mixin) GetSchema() (string, error)

func (*Mixin) PrintSchema

func (m *Mixin) PrintSchema() error

func (*Mixin) PrintVersion

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

type MixinConfig

type MixinConfig struct {
	ClientVersion string `yaml:"clientVersion,omitempty"`
}

type Step

type Step struct {
	*Instruction `yaml:"handlebars"`
}

type TestMixin

type TestMixin struct {
	*Mixin
	TestContext *context.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