Documentation
¶
Index ¶
- type CmdOutputType
- type Cookie
- type PreProcess
- type Request
- type RequestCookie
- type Response
- func (response Response) Body() []byte
- func (response Response) ServerResponseToGenericJSON(responseFormat ResponseFormat, bodyOnly bool) (interface{}, error)
- func (response Response) ServerResponseToJsonString(bodyOnly bool) (string, error)
- func (response Response) ToGenericJSON() (interface{}, error)
- func (response Response) ToString() string
- type ResponseFormat
- type ResponseSerialization
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdOutputType ¶ added in v0.99.0
type CmdOutputType string
const ( CmdOutputStdout CmdOutputType = "stdout" CmdOutputStderr CmdOutputType = "stderr" CmdOutputExitCode CmdOutputType = "exitcode" )
type Cookie ¶ added in v0.100.0
type Cookie struct { Name string `json:"name"` Value string `json:"value"` Path string `json:"path,omitempty"` Domain string `json:"domain,omitempty"` Expires time.Time `json:"expires,omitempty"` MaxAge int `json:"max_age,omitempty"` Secure bool `json:"secure,omitempty"` HttpOnly bool `json:"http_only,omitempty"` SameSite http.SameSite `json:"same_site,omitempty"` }
Cookie definition
type PreProcess ¶ added in v0.90.0
type PreProcess struct { Cmd struct { Name string `json:"name"` Args []string `json:"args,omitempty"` Output CmdOutputType `json:"output,omitempty"` } `json:"cmd"` }
func (*PreProcess) RunPreProcess ¶ added in v0.90.0
func (proc *PreProcess) RunPreProcess(response Response) (Response, error)
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"` NoRedirect bool `yaml:"no_redirect" json:"no_redirect"` 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"` Cookies map[string]*RequestCookie `yaml:"cookies" json:"cookies"` SetCookies []*Cookie `yaml:"header-x-test-set-cookie" json:"header-x-test-set-cookie"` BodyType string `yaml:"body_type" json:"body_type"` BodyFile string `yaml:"body_file" json:"body_file"` Body interface{} `yaml:"body" json:"body"` DoNotStore bool ManifestDir string DataStore *datastore.Datastore // contains filtered or unexported fields }
type RequestCookie ¶ added in v0.100.0
type Response ¶
type Response struct { Format ResponseFormat // contains filtered or unexported fields }
func NewResponse ¶
func NewResponseFromSpec ¶
func NewResponseFromSpec(spec ResponseSerialization) (res Response, err error)
func (Response) ServerResponseToGenericJSON ¶ added in v0.90.0
func (response Response) ServerResponseToGenericJSON(responseFormat ResponseFormat, bodyOnly bool) (interface{}, error)
ServerResponseToGenericJSON parse response from server. convert xml, csv, binary to json if necessary
func (Response) ServerResponseToJsonString ¶ added in v0.90.0
func (Response) ToGenericJSON ¶ added in v0.90.0
ToGenericJSON parse expected response
type ResponseFormat ¶ added in v0.90.0
type ResponseFormat struct { IgnoreBody bool `json:"-"` // if true, do not try to parse the body (since it is not expected in the response) Type string `json:"type"` // default "json", allowed: "csv", "json", "xml", "binary" CSV struct { Comma string `json:"comma,omitempty"` } `json:"csv,omitempty"` PreProcess *PreProcess `json:"pre_process,omitempty"` }
type ResponseSerialization ¶
type ResponseSerialization struct { StatusCode int `yaml:"statuscode" json:"statuscode"` Headers map[string][]string `yaml:"header" json:"header,omitempty"` Cookies map[string]Cookie `yaml:"cookie" json:"cookie,omitempty"` Body interface{} `yaml:"body" json:"body,omitempty"` BodyControl util.JsonObject `yaml:"body:control" json:"body:control,omitempty"` Format ResponseFormat `yaml:"format" json:"format,omitempty"` }
Click to show internal directories.
Click to hide internal directories.