Help us shape the future of Go! Take the 2026 Go Developer Survey

lib

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllParsedSecrets added in v0.6.0

type AllParsedSecrets map[string]ParsedSecret

type AuthCfg added in v0.7.0

type AuthCfg struct {
	BasicAuth  *BasicAuthCfg  `hcl:"basic,block"`
	BearerAuth *BearerAuthCfg `hcl:"bearer,block"`
}

type BasicAuthCfg added in v0.9.0

type BasicAuthCfg struct {
	Body hcl.Body `hcl:",remain"`
}

type BearerAuthCfg added in v0.9.0

type BearerAuthCfg struct {
	Body hcl.Body `hcl:",remain"`
}

type EnvironmentCfg

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

type EnvironmentCfgs added in v0.6.0

type EnvironmentCfgs []*EnvironmentCfg

type EvalContext added in v0.5.4

type EvalContext struct {
	Functions     *map[string]function.Function
	Variables     *map[string]cty.Value
	Environment   *cty.Value
	RequestAsVars RequestAsVars
	RawRequests   RequestCfgs
	RawDynamics   VariableCfgs
}

func LoadEvalCtx added in v0.5.4

func LoadEvalCtx(env string, execCtx *ExecutionContext) (*EvalContext, error)

Get all internal functions Parse external functions Parse environment variables Parse variables Create EvalContext

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 ExternalFunctionCfgs added in v0.6.0

type ExternalFunctionCfgs []*ExternalFunctionCfg

type GofakeitFunc added in v0.7.0

type GofakeitFunc struct {
	Params []function.Parameter
	Type   function.TypeFunc
	Impl   function.ImplFunc
}

type ParsedSecret added in v0.6.0

type ParsedSecret map[string]string

type Request

type Request struct {
	Method  string
	Url     string
	Headers map[string]string
	Body    string
	EvalContext
	PrecedingRequests []*Response
	*Response
	*ExecutionContext
	RoundTripper http.RoundTripper
}

func LoadOnlyRequest added in v0.5.4

func LoadOnlyRequest(name string, evCtx *EvalContext, execCtx *ExecutionContext) (request *Request, err error)

Load only request with given EvalContext

func LoadWhole added in v0.5.4

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

Gather EvalContext and load given request

func (*Request) Exec added in v0.7.0

func (request *Request) Exec() error

type RequestAsVars added in v0.5.7

type RequestAsVars map[string]cty.Value

type RequestCfg

type RequestCfg struct {
	Name      string   `hcl:"name,label"`
	DependsOn []string `hcl:"depends_on,optional"`
	Body      hcl.Body `hcl:",remain"`
	Auth      *AuthCfg `hcl:"auth,block"`
}

type RequestCfgs

type RequestCfgs []*RequestCfg

type RequestTiming

type RequestTiming struct {
	// DNS resolve time
	Dns time.Duration
	// Time to establish connection
	Conn time.Duration
	// TLS handshake time
	Tls time.Duration
	// Time to first byte
	FirstByte time.Duration
	// Total request duration
	Total time.Duration
}

type Requests

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

type Response

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

type RootCfg

type RootCfg struct {
	Requests          RequestCfgs          `hcl:"request,block"`
	Variables         VariableCfgs         `hcl:"variable,block"`
	Dynamics          VariableCfgs         `hcl:"dynamic,block"`
	Environments      EnvironmentCfgs      `hcl:"env,block"`
	ExternalFunctions ExternalFunctionCfgs `hcl:"external-function,block"`
	Version           string               `hcl:"version,optional"`
}

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 SecretCfgs added in v0.6.0

type SecretCfgs []*SecretCfg

type VariableCfg

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

type VariableCfgs added in v0.6.0

type VariableCfgs []*VariableCfg

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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