request

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POST = iota
	PUT
	PATCH
	DELETE
	GET
	HEAD
)
View Source
const (
	Validate processors.Type = iota
	Build
	BuildStream
	Sign
	Send
	ValidateResponse
	Unmarshal
	UnmarshalStream
	UnmarshalMeta
	UnmarshalError
	Retry
	AfterRetry
	CompleteAttempt
	Complete
)

Variables

View Source
var NoBody = http.NoBody

NoBody is a http.NoBody reader instructing Go HTTP client to not include and body in the HTTP request.

Functions

func EscapePath

func EscapePath(path string, encodeSep bool) string

EscapePath escapes part of a URL path in Amazon style

Types

type HTTP

type HTTP struct {
	Method      HTTPMethod
	Path        string
	UsePathAsIs bool
}

type HTTPMethod

type HTTPMethod int8

func (HTTPMethod) String

func (v HTTPMethod) String() string

type Operation

type Operation struct {
	Name string
	Http HTTP
}

type Request

type Request struct {
	RuntimeConfig *sap.RuntimeConfig
	ServiceInfo   metainfo.ServiceInfo

	Processors *processors.Processors
	Operation  *Operation

	CreationTime time.Time
	LastSignedAt time.Time
	AttemptTime  time.Time

	HTTPResponse        *http.Response
	ResponseBody        []byte
	ResponseBodyHandler func(int, []byte) ([]byte, error)
	OutputData          interface{}

	HTTPRequest *http.Request

	InputData interface{}

	Error error

	//RetryCount int
	Retryable bool

	DisableFollowRedirects bool
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg *sap.RuntimeConfig, serviceInfo metainfo.ServiceInfo, processors *processors.Processors,
	operation *Operation, params interface{}, data interface{}) *Request

func (*Request) Build

func (r *Request) Build() error

func (*Request) BuildAndSanitize

func (r *Request) BuildAndSanitize() error

func (*Request) Context

func (r *Request) Context() context.Context

func (*Request) HasError

func (r *Request) HasError() bool

func (*Request) InputDataFilled

func (r *Request) InputDataFilled() bool

func (*Request) OutputDataFilled

func (r *Request) OutputDataFilled() bool

func (*Request) ResetBody

func (r *Request) ResetBody()

func (*Request) Send

func (r *Request) Send() error

func (*Request) SetBytesBody

func (r *Request) SetBytesBody(buf []byte)

SetBufferBody will set the request's body bytes that will be sent to the service API.

func (*Request) SetReaderBody

func (r *Request) SetReaderBody(reader io.ReadSeeker)

SetReaderBody will set the request's body reader.

func (*Request) SetStringBody

func (r *Request) SetStringBody(s string)

SetStringBody sets the body of the request to be backed by a string.

func (*Request) Sign

func (r *Request) Sign() error

Directories

Path Synopsis
processors

Jump to

Keyboard shortcuts

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