lib

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvironmentCfg

type EnvironmentCfg struct {
	Name      string       `hcl:"name,label"`
	Default   bool         `hcl:"default,optional"`
	Secrets   []*SecretCfg `hcl:"secrets,block"`
	Variables hcl.Body     `hcl:",remain"`
}

type Environments

type Environments map[string]cty.Value

type ExecutionContext added in v0.5.1

type ExecutionContext struct {
	Version string
	Debug   bool
}

type ExternalFunctionCfg added in v0.5.0

type ExternalFunctionCfg struct {
	Name        string   `hcl:"name,label"`
	Interpreter string   `hcl:"interpreter,attr"`
	Script      string   `hcl:"script,attr"`
	Args        []string `hcl:"args,optional"`
}

type Request

type Request struct {
	Method  string
	Url     string
	Headers map[string]string
	Body    string
}

func LoadOne

func LoadOne(name, env string, execCtx *ExecutionContext) (request Request, err error)

type RequestCfg

type RequestCfg struct {
	Name string   `hcl:"name,label"`
	Body hcl.Body `hcl:",remain"`
}

type RequestCfgs

type RequestCfgs []*RequestCfg

type RequestTiming

type RequestTiming struct {
	Dns       time.Duration
	Conn      time.Duration
	Tls       time.Duration
	FirstByte time.Duration
	Total     time.Duration
}

type Requests

type Requests map[string]map[string]cty.Value

type Response

type Response struct {
	StatusCode int
	Proto      string
	Body       []byte
	Headers    http.Header
	Timing     RequestTiming
}

func DoRequest

func DoRequest(request Request, execCtx *ExecutionContext) (response Response)

type RootCfg

type RootCfg struct {
	Requests          []*RequestCfg          `hcl:"request,block"`
	Variables         []*VariableCfg         `hcl:"variable,block"`
	Environments      []*EnvironmentCfg      `hcl:"env,block"`
	ExternalFunctions []*ExternalFunctionCfg `hcl:"external-function,block"`
}

type SecretCfg added in v0.3.0

type SecretCfg struct {
	Name  string            `hcl:"name,label"`
	Type  string            `hcl:"type,attr"`
	Paths map[string]string `hcl:"paths,attr"`
}

type VariableCfg

type VariableCfg struct {
	Name  string   `hcl:"name,label"`
	Value hcl.Body `hcl:"value,remain"`
}

Jump to

Keyboard shortcuts

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