rest

package
v3.1.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInterface

type ClientInterface interface {
	Verb(verb VerbType) *Request
	Post() *Request
	Put() *Request
	Get() *Request
	Delete() *Request
	Patch() *Request
}

func NewRESTClient

func NewRESTClient(c *util.Capability, baseUrl string) ClientInterface

type RESTClient

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

func (*RESTClient) Delete

func (r *RESTClient) Delete() *Request

func (*RESTClient) Get

func (r *RESTClient) Get() *Request

func (*RESTClient) Patch

func (r *RESTClient) Patch() *Request

func (*RESTClient) Post

func (r *RESTClient) Post() *Request

func (*RESTClient) Put

func (r *RESTClient) Put() *Request

func (*RESTClient) Verb

func (r *RESTClient) Verb(verb VerbType) *Request

type Request

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

func (*Request) Body

func (r *Request) Body(body interface{}) *Request

func (*Request) Do

func (r *Request) Do() *Result

func (*Request) SubResource

func (r *Request) SubResource(subPath string) *Request

func (*Request) WithContext

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

func (*Request) WithHeaders

func (r *Request) WithHeaders(header http.Header) *Request

func (*Request) WithParam

func (r *Request) WithParam(paramName, value string) *Request

func (*Request) WithTimeout

func (r *Request) WithTimeout(d time.Duration) *Request

func (*Request) WrapURL

func (r *Request) WrapURL() *url.URL

type Result

type Result struct {
	Body       []byte
	Err        error
	StatusCode int
}

func (*Result) Into

func (r *Result) Into(obj interface{}) error

type VerbType

type VerbType string

http request verb type

Jump to

Keyboard shortcuts

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