types

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonEnvironmentType     EnvironmentType = "common"
	LocalEnvironmentType                      = "local"
	ContainerEnvironmentType                  = "container"
	DockerEnvironmentType                     = "docker"
	KubernetesEnvironmentType                 = "kubernetes"
)
View Source
const (
	CommonSandboxType     SandboxType = "common"
	LocalSandboxType                  = "local"
	ContainerSandboxType              = "container"
	DockerSandboxType                 = "docker"
	KubernetesSandboxType             = "kubernetes"
)
View Source
const (
	ReloadSandboxHookType  SandboxHookType = "reload"
	RestartSandboxHookType                 = "restart"
	StartSandboxHookType                   = "start"
	StopSandboxHookType                    = "stop"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
}

type BenchAction

type BenchAction struct {
	Service   string  `wst:"service"`
	Timeout   int     `wst:"timeout"`
	When      string  `wst:"when,enum=always|on_success|on_fail,default=on_success"`
	Id        string  `wst:"id,default=last"`
	Path      string  `wst:"path"`
	Method    string  `wst:"method,enum=GET|HEAD|DELETE|POST|PUT|PATCH|PURGE,default=GET"`
	Headers   Headers `wst:"headers"`
	Frequency int     `wst:"frequency"`
	Duration  int     `wst:"duration"`
}

type CommonEnvironment

type CommonEnvironment struct {
	Ports EnvironmentPorts `wst:"ports"`
}

type CommonSandbox

type CommonSandbox struct {
	Available bool                   `wst:"available,default=true"`
	Dirs      map[string]string      `wst:"dirs,keys=conf|run|script"`
	Hooks     map[string]SandboxHook `wst:"hooks,factory=createHooks"`
}

type Config

type Config struct {
	Version     string `wst:"version,enum=0.1"`
	Name        string `wst:"name"`
	Description string `wst:"description"`
	Spec        Spec   `wst:"spec"`
}

type ContainerEnvironment

type ContainerEnvironment struct {
	Ports    EnvironmentPorts  `wst:"ports"`
	Registry ContainerRegistry `wst:"registry"`
}

type ContainerImage

type ContainerImage struct {
	Name string `wst:"name"`
	Tag  string `wst:"tag"`
}

type ContainerRegistry

type ContainerRegistry struct {
	Auth ContainerRegistryAuth `wst:"auth"`
}

type ContainerRegistryAuth

type ContainerRegistryAuth struct {
	Username string `wst:"username"`
	Password string `wst:"password"`
}

type ContainerSandbox

type ContainerSandbox struct {
	Available bool                   `wst:"available,default=true"`
	Dirs      map[string]string      `wst:"dirs,keys=conf|run|script"`
	Hooks     map[string]SandboxHook `wst:"hooks,factory=createHooks"`
	Image     ContainerImage         `wst:"image,factory=createContainerImage"`
	Registry  ContainerRegistry      `wst:"registry"`
}

type CustomExpectation

type CustomExpectation struct {
	Name       string     `wst:"name"`
	Parameters Parameters `wst:"parameters,factory=createParameters"`
}

type CustomExpectationAction

type CustomExpectationAction struct {
	Service string            `wst:"service"`
	Timeout int               `wst:"timeout"`
	When    string            `wst:"when,enum=always|on_success|on_fail,default=on_success"`
	Custom  CustomExpectation `wst:"custom"`
}

type DockerEnvironment

type DockerEnvironment struct {
	Ports      EnvironmentPorts  `wst:"ports"`
	Registry   ContainerRegistry `wst:"registry"`
	NamePrefix string            `wst:"name_prefix"`
}

type DockerSandbox

type DockerSandbox struct {
	Available bool                   `wst:"available,default=true"`
	Dirs      map[string]string      `wst:"dirs,keys=conf|run|script"`
	Hooks     map[string]SandboxHook `wst:"hooks,factory=createHooks"`
	Image     ContainerImage         `wst:"image,factory=createContainerImage"`
	Registry  ContainerRegistry      `wst:"registry"`
}

type Environment

type Environment interface {
}

type EnvironmentPorts

type EnvironmentPorts struct {
	Start int32 `wst:"start"`
	End   int32 `wst:"end"`
}

type EnvironmentType

type EnvironmentType string

type ExpectationAction

type ExpectationAction interface {
	Action
}

type Headers

type Headers map[string]string

type Instance

type Instance struct {
	Name         string                 `wst:"name"`
	Title        string                 `wst:"title"`
	Description  string                 `wst:"description"`
	Labels       []string               `wst:"labels"`
	Resources    Resources              `wst:"resources"`
	Services     map[string]Service     `wst:"services,loadable"`
	Timeouts     InstanceTimeouts       `wst:"timeouts"`
	Environments map[string]Environment `wst:"environments,loadable,factory=createEnvironments"`
	Actions      []Action               `wst:"actions,factory=createActions"`
}

type InstanceTimeouts

type InstanceTimeouts struct {
	Action  int `wst:"action,default=30000"`
	Actions int `wst:"actions,default=0"`
}

type KubernetesEnvironment

type KubernetesEnvironment struct {
	Ports      EnvironmentPorts  `wst:"ports"`
	Registry   ContainerRegistry `wst:"registry"`
	Namespace  string            `wst:"namespace"`
	Kubeconfig string            `wst:"kubeconfig,path=virtual"`
}

type KubernetesSandbox

type KubernetesSandbox struct {
	Available bool                   `wst:"available,default=true"`
	Dirs      map[string]string      `wst:"dirs,keys=conf|run|script"`
	Hooks     map[string]SandboxHook `wst:"hooks,factory=createHooks"`
	Image     ContainerImage         `wst:"image,factory=createContainerImage"`
	Registry  ContainerRegistry      `wst:"registry"`
}

type LocalEnvironment

type LocalEnvironment struct {
	Ports EnvironmentPorts `wst:"ports"`
}

type LocalSandbox

type LocalSandbox struct {
	Available bool                   `wst:"available,default=true"`
	Dirs      map[string]string      `wst:"dirs,keys=conf|run|script"`
	Hooks     map[string]SandboxHook `wst:"hooks,factory=createHooks"`
}

type MetricRule

type MetricRule struct {
	Metric   string  `wst:"metric"`
	Operator string  `wst:"operator,enum=eq,ne,gt,lt,ge,le"`
	Value    float64 `wst:"value"`
}

type MetricsExpectation

type MetricsExpectation struct {
	Id    string       `wst:"id,default=last"`
	Rules []MetricRule `wst:"rules"`
}

type MetricsExpectationAction

type MetricsExpectationAction struct {
	Service string             `wst:"service"`
	Timeout int                `wst:"timeout"`
	When    string             `wst:"when,enum=always|on_success|on_fail,default=on_success"`
	Metrics MetricsExpectation `wst:"metrics"`
}

type NotAction

type NotAction struct {
	Action  Action `wst:"action,factory=createAction"`
	Timeout int    `wst:"timeout"`
	When    string `wst:"when,enum=always|on_success|on_fail,default=on_success"`
}

type OutputExpectation

type OutputExpectation struct {
	Order          string   `wst:"order,enum=fixed|random,default=fixed"`
	Match          string   `wst:"match,enum=exact|regexp,default=exact"`
	Type           string   `wst:"type,enum=stdout|stderr|any,default=any"`
	RenderTemplate bool     `wst:"render_template,default=true"`
	Messages       []string `wst:"messages"`
}

type OutputExpectationAction

type OutputExpectationAction struct {
	Service string            `wst:"service"`
	Timeout int               `wst:"timeout"`
	When    string            `wst:"when,enum=always|on_success|on_fail,default=on_success"`
	Output  OutputExpectation `wst:"output"`
}

type ParallelAction

type ParallelAction struct {
	Actions []Action `wst:"actions,factory=createActions"`
	Timeout int      `wst:"timeout"`
	When    string   `wst:"when,enum=always|on_success|on_fail,default=on_success"`
}

type Parameters

type Parameters map[string]interface{}

type ReloadAction

type ReloadAction struct {
	Service  string   `wst:"service"`
	Services []string `wst:"service"`
	Timeout  int      `wst:"timeout"`
	When     string   `wst:"when,enum=always|on_success|on_fail,default=on_success"`
}

type RequestAction

type RequestAction struct {
	Service string  `wst:"service"`
	Timeout int     `wst:"timeout"`
	When    string  `wst:"when,enum=always|on_success|on_fail,default=on_success"`
	Id      string  `wst:"id,default=last"`
	Path    string  `wst:"path"`
	Method  string  `wst:"method,enum=GET|HEAD|DELETE|POST|PUT|PATCH|PURGE,default=GET"`
	Headers Headers `wst:"headers"`
}

type Resources

type Resources struct {
	Scripts map[string]Script `wst:"scripts,string=Content"`
}

type ResponseBody

type ResponseBody struct {
	Content        string `wst:"content"`
	Match          string `wst:"match,enum=exact|regexp,default=exact"`
	RenderTemplate bool   `wst:"render_template,default=true"`
}

type ResponseExpectation

type ResponseExpectation struct {
	Request string       `wst:"request,default=last"`
	Headers Headers      `wst:"headers"`
	Body    ResponseBody `wst:"body,string=Content"`
}

type ResponseExpectationAction

type ResponseExpectationAction struct {
	Service  string              `wst:"service"`
	Timeout  int                 `wst:"timeout"`
	When     string              `wst:"when,enum=always|on_success|on_fail,default=on_success"`
	Response ResponseExpectation `wst:"response"`
}

type RestartAction

type RestartAction struct {
	Service  string   `wst:"service"`
	Services []string `wst:"service"`
	Timeout  int      `wst:"timeout"`
	When     string   `wst:"when,enum=always|on_success|on_fail,default=on_success"`
}

type Sandbox

type Sandbox interface{}

type SandboxHook

type SandboxHook interface {
}

type SandboxHookArgsCommand

type SandboxHookArgsCommand struct {
	Executable string   `wst:"executable"`
	Args       []string `wst:"args"`
}

type SandboxHookNative

type SandboxHookNative struct {
	Enabled bool `wst:"enabled,default=true"`
	Force   bool `wst:"force,default=false"`
}

type SandboxHookShellCommand

type SandboxHookShellCommand struct {
	Command string `wst:"command"`
	Shell   string `wst:"shell"`
}

type SandboxHookSignal

type SandboxHookSignal struct {
	IsString    bool
	StringValue string
	IntValue    int
}

type SandboxHookType

type SandboxHookType string

type SandboxType

type SandboxType string

type Script

type Script struct {
	Content    string     `wst:"content"`
	Path       string     `wst:"path"`
	Mode       string     `wst:"mode,default=0644"`
	Parameters Parameters `wst:"parameters,factory=createParameters"`
}

type Server

type Server struct {
	Name       string                    `wst:"name"`
	Tag        string                    `wst:"tag"`
	Extends    string                    `wst:"extends"`
	User       string                    `wst:"user"`
	Group      string                    `wst:"group"`
	Port       int32                     `wst:"port"`
	Configs    map[string]ServerConfig   `wst:"configs"`
	Templates  map[string]ServerTemplate `wst:"templates"`
	Sandboxes  map[string]Sandbox        `wst:"sandboxes,factory=createSandboxes"`
	Parameters Parameters                `wst:"parameters,factory=createParameters"`
	Actions    ServerActions             `wst:"actions"`
}

type ServerActions

type ServerActions struct {
	Expect map[string]ServerExpectationAction `wst:"expect,factory=createServerExpectations"`
}

type ServerConfig

type ServerConfig struct {
	File       string     `wst:"file,path"`
	Parameters Parameters `wst:"parameters,factory=createParameters"`
}

type ServerExpectationAction

type ServerExpectationAction interface {
}

type ServerMetricsExpectation

type ServerMetricsExpectation struct {
	Parameters Parameters         `wst:"parameters,factory=createParameters"`
	Metrics    MetricsExpectation `wst:"metrics"`
}

type ServerOutputExpectation

type ServerOutputExpectation struct {
	Parameters Parameters        `wst:"parameters,factory=createParameters"`
	Output     OutputExpectation `wst:"output"`
}

type ServerResponseExpectation

type ServerResponseExpectation struct {
	Parameters Parameters          `wst:"parameters,factory=createParameters"`
	Response   ResponseExpectation `wst:"response"`
}

type ServerTemplate

type ServerTemplate struct {
	File string `wst:"file,path"`
}

type Service

type Service struct {
	Server    ServiceServer    `wst:"server"`
	Resources ServiceResources `wst:"resources"`
	Requires  []string         `wst:"requires"`
	Public    bool             `wst:"public,default=false"`
}

type ServiceConfig

type ServiceConfig struct {
	Parameters Parameters `wst:"parameters,factory=createParameters"`
	Include    bool       `wst:"include,default=true"`
}

type ServiceResources

type ServiceResources struct {
	Scripts ServiceScripts `wst:"scripts,factory=createServiceScripts"`
}

type ServiceScripts

type ServiceScripts struct {
	IncludeAll  bool
	IncludeList []string
}

type ServiceServer

type ServiceServer struct {
	Name       string                   `wst:"name"`
	Tag        string                   `wst:"tag"`
	Sandbox    string                   `wst:"sandbox,enum=local|docker|kubernetes"`
	Configs    map[string]ServiceConfig `wst:"configs"`
	Parameters Parameters               `wst:"parameters,factory=createParameters"`
}

type Spec

type Spec struct {
	Environments map[string]Environment `wst:"environments,loadable,factory=createEnvironments"`
	Instances    []Instance             `wst:"instances,loadable"`
	Sandboxes    map[string]Sandbox     `wst:"sandboxes,loadable,factory=createSandboxes"`
	Servers      []Server               `wst:"servers,loadable"`
	Workspace    string                 `wst:"workspace,path=virtual"`
	Defaults     SpecDefaults           `wst:"defaults,loadable"`
}

type SpecDefaults

type SpecDefaults struct {
	Service    SpecServiceDefaults `wst:"service"`
	Timeouts   SpecTimeouts        `wst:"timeouts"`
	Parameters Parameters          `wst:"parameters,factory=createParameters"`
}

type SpecServiceDefaults

type SpecServiceDefaults struct {
	Sandbox string                    `wst:"sandbox,enum=local|docker|kubernetes,default=local"`
	Server  SpecServiceServerDefaults `wst:"server"`
}

type SpecServiceServerDefaults

type SpecServiceServerDefaults struct {
	Tag string `wst:"tag,default=default"`
}

type SpecTimeouts

type SpecTimeouts struct {
	Action  int `wst:"action,default=0"`
	Actions int `wst:"actions,default=0"`
}

type StartAction

type StartAction struct {
	Service  string   `wst:"service"`
	Services []string `wst:"service"`
	Timeout  int      `wst:"timeout"`
	When     string   `wst:"when,enum=always|on_success|on_fail,default=on_success"`
}

type StopAction

type StopAction struct {
	Service  string   `wst:"service"`
	Services []string `wst:"service"`
	Timeout  int      `wst:"timeout"`
	When     string   `wst:"when,enum=always|on_success|on_fail,default=always"`
}

Jump to

Keyboard shortcuts

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