rest

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 24 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) Peek

func (r *Request) Peek() *Request

func (*Request) SubResourcef

func (r *Request) SubResourcef(subPath string, args ...interface{}) *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) WithParams

func (r *Request) WithParams(params map[string]string) *Request

func (*Request) WithParamsFromURL

func (r *Request) WithParamsFromURL(u *url.URL) *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 {
	Rid        string
	Body       []byte
	Err        error
	StatusCode int
	Status     string
	Header     http.Header
}

func (*Result) Into

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

func (*Result) IntoJsonCntInfoString

func (r *Result) IntoJsonCntInfoString() (*metadata.JsonCntInfoResp, error)

func (*Result) IntoJsonString

func (r *Result) IntoJsonString() (*metadata.JsonStringResp, 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