api

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Endpoint             string                 `yaml:"endpoint" json:"endpoint"`
	ServerURL            string                 `yaml:"server_url" json:"server_url"`
	Method               string                 `yaml:"method" json:"method"`
	QueryParams          map[string]interface{} `yaml:"query_params" json:"query_params"`
	QueryParamsFromStore map[string]string      `yaml:"query_params_from_store" json:"query_params_from_store"`
	Headers              map[string]*string     `yaml:"header" json:"header"`
	HeaderFromStore      map[string]string      `yaml:"header_from_store" json:"header_from_store"`
	BodyType             string                 `yaml:"body_type" json:"body_type"`
	Body                 util.GenericJson       `yaml:"body" json:"body"`

	DoNotStore  bool
	ManifestDir string
	DataStore   *datastore.Datastore
	// contains filtered or unexported fields
}

func (Request) Send

func (request Request) Send() (response Response, err error)

func (Request) ToString

func (request Request) ToString(curl bool) (res string)

type Response

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

func NewResponse

func NewResponse(statusCode int, headers map[string][]string, body io.Reader, bodyControl util.JsonObject) (res Response, err error)

func NewResponseFromSpec

func NewResponseFromSpec(spec ResponseSerialization) (res Response, err error)

func (Response) Body

func (response Response) Body() []byte

func (*Response) CheckAndConvertXML

func (response *Response) CheckAndConvertXML() (gotXML bool, err error)

func (Response) ToGenericJson

func (response Response) ToGenericJson() (res util.GenericJson, err error)

func (Response) ToJsonString

func (response Response) ToJsonString() (string, error)

func (Response) ToString

func (response Response) ToString() (res string)

type ResponseSerialization

type ResponseSerialization struct {
	StatusCode  int                 `yaml:"statuscode" json:"statuscode"`
	Headers     map[string][]string `yaml:"header" json:"header,omitempty"`
	Body        util.GenericJson    `yaml:"body" json:"body,omitempty"`
	BodyControl util.JsonObject     `yaml:"body:control" json:"body:control,omitempty"`
}

Jump to

Keyboard shortcuts

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