communication

package
v0.0.0-...-97c5a11 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause, MIT Imports: 7 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PseudoUUID

func PseudoUUID() (string, error)

PseudoUUID returns a pseudo UUID

Types

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

Header represents a single response header. Immutable.

func NewHeader

func NewHeader(name, value string) (*Header, error)

NewHeader returns a Header with the given name and value

func (Header) Name

func (h Header) Name() string

Name returns the name of the header

func (Header) String

func (h Header) String() string

String is the implementation of the Stringer interface Format: 'name:value'

func (Header) Value

func (h Header) Value() string

Value returns the value of the header

type Headers

type Headers []Header

Headers represents a slice of Header

func (Headers) GetDispositionFilename

func (h Headers) GetDispositionFilename() string

GetDispositionFilename returns the content of the filename found in the Content-Disposition header, or the empty string if it couldn't have been found.

func (Headers) GetHeader

func (h Headers) GetHeader(headerName string) *Header

GetHeader searches for the headerName in the headers

func (Headers) GetHeaderValue

func (h Headers) GetHeaderValue(headerName string) string

GetHeaderValue searches for the header name and returns the value as string, or the empty string if it doesn't exist. This doesn't break HTTP support since headers can't have empty values

func (Headers) Len

func (h Headers) Len() int

Len represents the length of the slice

func (Headers) Less

func (h Headers) Less(i, j int) bool

Less checks if two positions are in lexicographic order

func (Headers) Swap

func (h Headers) Swap(i, j int)

Swap swaps two elements

type MultipartFormDataObject

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

MultipartFormDataObject is a representation of a multipart/form-data object.

func NewMultipartFormDataObject

func NewMultipartFormDataObject() (*MultipartFormDataObject, error)

NewMultipartFormDataObject constructs a new MultipartFormDataObject

func (*MultipartFormDataObject) AddFile

func (multipart *MultipartFormDataObject) AddFile(parameterName string, file domain.UploadableFile) error

AddFile adds a file parameter.

func (*MultipartFormDataObject) AddValue

func (multipart *MultipartFormDataObject) AddValue(parameterName string, value string) error

AddValue adds a value parameter.

func (*MultipartFormDataObject) GetBoundary

func (multipart *MultipartFormDataObject) GetBoundary() string

GetBoundary returns the boundary.

func (*MultipartFormDataObject) GetContentType

func (multipart *MultipartFormDataObject) GetContentType() string

GetContentType returns the content type.

func (*MultipartFormDataObject) GetFiles

func (multipart *MultipartFormDataObject) GetFiles() map[string]domain.UploadableFile

GetFiles returns the files.

func (*MultipartFormDataObject) GetValues

func (multipart *MultipartFormDataObject) GetValues() map[string]string

GetValues returns the values.

type MultipartFormDataRequest

type MultipartFormDataRequest interface {

	// ToMultipartFormDataObject converts this multipart/form-data request into a MultipartFormDataObject.
	ToMultipartFormDataObject() *MultipartFormDataObject
}

MultipartFormDataRequest represents a multipart/form-data request.

type ParamRequest

type ParamRequest interface {

	// ToRequestParameters converts this set of request parameters to a slice of RequestParam
	ToRequestParameters() RequestParams
}

ParamRequest represents a set of request parameters.

type RequestParam

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

RequestParam represents a single request parameter. Immutable.

func NewRequestParam

func NewRequestParam(name, value string) (*RequestParam, error)

NewRequestParam creates a RequestParam with the given name and value

func (RequestParam) Name

func (rp RequestParam) Name() string

Name returns the name of the RequestParam

func (RequestParam) String

func (rp RequestParam) String() string

String is the implementation of the Stringer interface Format: 'name:value'

func (RequestParam) Value

func (rp RequestParam) Value() string

Value returns the value of the RequestParam

type RequestParams

type RequestParams []RequestParam

RequestParams represents a slice of RequestParam

type ResponseHandler

type ResponseHandler func(statusCode int, headers []Header, reader io.Reader) (interface{}, error)

ResponseHandler is a function for handling incoming responses

Jump to

Keyboard shortcuts

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