response

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Name          string              `json:"name,omitempty"`
	URI           string              `json:"uri,omitempty"` // Called URI by downstream
	Type          string              `json:"type,omitempty"`
	IPAddresses   []string            `json:"ip_addresses,omitempty"`
	Path          []string            `json:"path,omitempty"` // Path received by upstream
	StartTime     string              `json:"start_time,omitempty"`
	EndTime       string              `json:"end_time,omitempty"`
	Duration      string              `json:"duration,omitempty"`
	Headers       map[string]string   `json:"headers,omitempty"`
	Cookies       map[string]string   `json:"cookies,omitempty"`
	Body          json.RawMessage     `json:"body,omitempty"`
	UpstreamCalls map[string]Response `json:"upstream_calls,omitempty"`
	Code          int                 `json:"code"`
	Error         string              `json:"error,omitempty"`
}

Response defines the type which is returned from the service

func (*Response) AppendUpstream

func (r *Response) AppendUpstream(key string, resp Response)

AppendUpstream appends an upstream response to this object

func (*Response) AppendUpstreams

func (r *Response) AppendUpstreams(reps map[string]Response)

AppendUpstreams appends multiple upstream responses to this object

func (*Response) FromJSON

func (r *Response) FromJSON(d []byte) error

FromJSON populates the response from a JSON string

func (*Response) ToJSON

func (r *Response) ToJSON() string

ToJSON converts the response to a JSON string

Jump to

Keyboard shortcuts

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