requests

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 2 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 {
	// contains filtered or unexported fields
}

A Request holds the arguments for an http request to the server.

func NewEmptyReq

func NewEmptyReq() *Request

NewEmptyReq creates a new request that needs no arguments, and hence no validation to be used.

func NewReq

func NewReq(required []string) *Request

NewReq creates a new request with the required arguments to be meet as a string array slice.

func (*Request) AddArgument

func (req *Request) AddArgument(key, value string)

AddArgument adds an argument to a request, guiven a pair key value.

func (*Request) AssertRequired

func (req *Request) AssertRequired() error

AssertRequired asserts that the required arguments of the request are meeted, if they arent, an error describing the missings required arguments is returned.

func (*Request) GetArguments

func (req *Request) GetArguments() map[string]string

GetArguments returns a map with both keys and values as strings.

Jump to

Keyboard shortcuts

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