producer

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResponse

func NewResponse(req *http.Request, resp *hclsyntax.Body, statusCode int) (*http.Response, error)

func NewURLFromAttribute added in v1.9.0

func NewURLFromAttribute(hclCtx *hcl.EvalContext, content *hclsyntax.Body, attrName string, req *http.Request) (*url.URL, error)

Types

type Proxy

type Proxy struct {
	Content *hclsyntax.Body
	Name    string // label

	RoundTrip http.RoundTripper
	// contains filtered or unexported fields
}

func (*Proxy) Produce added in v1.12.2

func (p *Proxy) Produce(clientReq *http.Request) *Result

func (*Proxy) SetDependsOn added in v1.12.2

func (p *Proxy) SetDependsOn(ps string)

type Redirect

type Redirect struct {
	Response
}

Redirect represents the generator <Redirect> object.

type Request

type Request struct {
	Backend http.RoundTripper
	Context *hclsyntax.Body
	Name    string // label
	// contains filtered or unexported fields
}

Request represents the producer <Request> object.

func (*Request) Produce added in v1.12.2

func (r *Request) Produce(req *http.Request) *Result

func (*Request) SetDependsOn added in v1.12.2

func (r *Request) SetDependsOn(ps string)

type Response

type Response struct {
	Context *hclsyntax.Body
}

Response represents the producer <Response> object.

type Result

type Result struct {
	Beresp        *http.Response
	Err           error
	RoundTripName string
}

Result represents the producer <Result> object.

type ResultMap

type ResultMap map[string]*Result

func (ResultMap) List

func (rm ResultMap) List() []*http.Response

type Results

type Results chan *Result

Results represents the producer <Result> channel.

type Roundtrip added in v1.7.0

type Roundtrip interface {
	Produce(req *http.Request) *Result
	SetDependsOn(ps string)
}

Jump to

Keyboard shortcuts

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