task

package
v0.0.0-...-fdc0f55 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigPlugins

func LoadConfigPlugins(
	ctx context.Context,
	reg config.ProviderRegistry,
	k6 K6,
) (func(), error)

func RunTask

func RunTask(
	ctx context.Context,
	target target.Target,
	getConfigProviderByName config.GetConfigProviderByName,
	taskConfig *Schema,
	sourceBaseDir string,
	script string,
	options ...RunTaskOption,
) error

Types

type ConfigProvider

type ConfigProvider struct {
	Provider ConfigProviderProviderSpec `json:"provider"`
	Env      string                     `json:"env"`
}

type ConfigProviderProviderSpec

type ConfigProviderProviderSpec struct {
	Name   string         `json:"name"`
	Params map[string]any `json:"params"`
}

type FileMount

type FileMount struct {
	Source string `json:"source"`
	Dest   string `json:"dest"`
}

type K6

type K6 struct {
	Namespace      string           `json:"namespace"`
	PodImage       string           `json:"image"`
	ControllerKind string           `json:"controllerKind"`
	JobSpec        struct{}         `json:"jobSpec"`
	PodSpec        struct{}         `json:"podSpec"`
	ConfigPlugins  []K6ConfigPlugin `json:"configPlugins"`
}

type K6ConfigPlugin

type K6ConfigPlugin struct {
	Namespace  string   `json:"namespace"`
	BinaryPath string   `json:"binaryPath"`
	Args       []string `json:"args"`
}

type RunTaskOption

type RunTaskOption interface {
	// contains filtered or unexported methods
}

RunTaskOption configures the behavior of RunTask.

func WithFollowLogs

func WithFollowLogs(followLogs bool) RunTaskOption

WithFollowLogs specifies whether to follow the logs of the task.

func WithInstances

func WithInstances(replicas int32) RunTaskOption

WithInstances specifies the number of instances to run.

type Schema

type Schema struct {
	Version string           `json:"version"`
	Name    string           `json:"name"`
	Files   []FileMount      `json:"files"`
	Configs []ConfigProvider `json:"configs"`
	K6      K6               `json:"k6"`
}

func LoadSchema

func LoadSchema(s io.Reader) (*Schema, error)

func LoadSchemaFromFile

func LoadSchemaFromFile(path string) (*Schema, error)

Jump to

Keyboard shortcuts

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