lib

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: GPL-3.0 Imports: 25 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 Request

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

func LoadOne

func LoadOne(name, env, version string) (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, version string) (response Response)

type RootCfg

type RootCfg struct {
	Requests     []*RequestCfg     `hcl:"request,block"`
	Variables    []*VariableCfg    `hcl:"variable,block"`
	Environments []*EnvironmentCfg `hcl:"env,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.Attributes `hcl:"value,remain"`
}

Jump to

Keyboard shortcuts

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