responses

package
v0.0.0-...-aa169ba Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Behavior

type Behavior struct {
	Wait       int    `json:"wait,omitempty"`
	DecorateFn string `json:"decorate,omitempty"`
}

type InjectBuilder

type InjectBuilder struct {
	// contains filtered or unexported fields
}

func Inject

func Inject() *InjectBuilder

func (*InjectBuilder) Build

func (builder *InjectBuilder) Build() Response

func (*InjectBuilder) Fn

func (builder *InjectBuilder) Fn(functionCode string) *InjectBuilder

type IsBuilder

type IsBuilder struct {
	// contains filtered or unexported fields
}

func Is

func Is() *IsBuilder

func (*IsBuilder) Body

func (builder *IsBuilder) Body(body string) *IsBuilder

func (*IsBuilder) Build

func (builder *IsBuilder) Build() IsElement

func (*IsBuilder) Decorate

func (builder *IsBuilder) Decorate(decorateFn string) *IsBuilder

func (*IsBuilder) Header

func (builder *IsBuilder) Header(header string, value string) *IsBuilder

func (*IsBuilder) StatusCode

func (builder *IsBuilder) StatusCode(statusCode int) *IsBuilder

func (*IsBuilder) Wait

func (builder *IsBuilder) Wait(waitTime int) *IsBuilder

type IsElement

type IsElement struct {
	Is       *IsResponse `json:"is"`
	Behavior *Behavior   `json:"_behaviors,omitempty"`
}

func (IsElement) Type

func (i IsElement) Type() string

type IsResponse

type IsResponse struct {
	StatusCode int               `json:"statusCode,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	Body       string            `json:"body,omitempty"`
}

type ProxyBuilder

type ProxyBuilder struct {
	// contains filtered or unexported fields
}

func Proxy

func Proxy() *ProxyBuilder

func (*ProxyBuilder) Build

func (builder *ProxyBuilder) Build() ProxyElement

func (*ProxyBuilder) Decorate

func (builder *ProxyBuilder) Decorate(decorateFn string) *ProxyBuilder

func (*ProxyBuilder) Mode

func (builder *ProxyBuilder) Mode(mode string) *ProxyBuilder

func (*ProxyBuilder) To

func (builder *ProxyBuilder) To(to string) *ProxyBuilder

func (*ProxyBuilder) Wait

func (builder *ProxyBuilder) Wait(waitTime int) *ProxyBuilder

type ProxyElement

type ProxyElement struct {
	Proxy    *ProxyResponse `json:"proxy"`
	Behavior *Behavior      `json:"_behaviors,omitempty"`
}

func (ProxyElement) Type

func (i ProxyElement) Type() string

type ProxyResponse

type ProxyResponse struct {
	To   string `json:"to,omitempty"`
	Mode string `json:"mode,omitempty"`
}

type Response

type Response interface {
	Type() string
}

Jump to

Keyboard shortcuts

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