builder

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package builder contains k6 builder logic.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPlatform = errors.New("invalid platform")

Functions

func EngineStrings added in v0.2.0

func EngineStrings() []string

EngineStrings returns a slice of all String values of the enum

func Preload added in v0.4.0

func Preload(
	ctx context.Context,
	builder Builder,
	mods dependency.Modules,
	platforms []*Platform,
) error

func WithReplacements added in v0.4.0

func WithReplacements(ctx context.Context, reps Replacements) context.Context

Types

type Builder added in v0.2.0

type Builder interface {
	Build(ctx context.Context, platform *Platform, mods dependency.Modules, out io.Writer) error
	Engine() Engine
}

func New added in v0.2.0

func New(ctx context.Context, engines ...Engine) (Builder, error)

type Engine added in v0.2.0

type Engine int
const (
	Native Engine = iota
	Docker
	Service
)

func DefaultEngines added in v0.4.0

func DefaultEngines() []Engine

func EngineString added in v0.2.0

func EngineString(s string) (Engine, error)

EngineString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func EngineValues added in v0.2.0

func EngineValues() []Engine

EngineValues returns all values of the enum

func (Engine) IsAEngine added in v0.2.0

func (i Engine) IsAEngine() bool

IsAEngine returns "true" if the value is listed in the enum definition. "false" otherwise

func (Engine) MarshalJSON added in v0.2.0

func (i Engine) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Engine

func (Engine) MarshalText added in v0.2.0

func (i Engine) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Engine

func (Engine) NewBuilder added in v0.4.0

func (e Engine) NewBuilder(ctx context.Context) (Builder, bool, error)

func (Engine) String added in v0.2.0

func (i Engine) String() string

func (*Engine) UnmarshalJSON added in v0.2.0

func (i *Engine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Engine

func (*Engine) UnmarshalText added in v0.2.0

func (i *Engine) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Engine

func (Engine) Values added in v0.2.0

func (Engine) Values() []string

type Platform added in v0.4.0

type Platform struct {
	OS   string
	Arch string
}

func NewPlatform added in v0.4.0

func NewPlatform(os, arch string) *Platform

func ParsePlatform added in v0.4.0

func ParsePlatform(str string) (*Platform, error)

func RuntimePlatform added in v0.4.0

func RuntimePlatform() *Platform

func SupportedPlatforms added in v0.4.0

func SupportedPlatforms() []*Platform

func (*Platform) String added in v0.4.0

func (p *Platform) String() string

func (*Platform) Supported added in v0.4.0

func (p *Platform) Supported() bool

type Replacement added in v0.4.0

type Replacement struct {
	Name string `json:"name,omitempty"`
	Path string `json:"path,omitempty"`
}

func NewReplacement added in v0.4.0

func NewReplacement(name, path string) *Replacement

func (*Replacement) String added in v0.4.0

func (rep *Replacement) String() string

type Replacements added in v0.4.0

type Replacements map[string]*Replacement

func (Replacements) MarshalJSON added in v0.4.0

func (reps Replacements) MarshalJSON() ([]byte, error)

func (Replacements) String added in v0.4.0

func (reps Replacements) String() string

Jump to

Keyboard shortcuts

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