v1alpha1

package
v1.12.1-RC1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(verb HttpVerb, baseurl, name string) (b []byte, err error)

API performs a REST API call to a given named action

func URL

func URL(verb HttpVerb, url string) (b []byte, err error)

URL performs a REST API call to a given url

Types

type HttpVerb

type HttpVerb string

HttpVerb is a typed constant that represents various http action

const (
	DeleteAction HttpVerb = "DELETE"
	PostAction   HttpVerb = "POST"
	GetAction    HttpVerb = "GET"
	PutAction    HttpVerb = "PUT"
	PatchAction  HttpVerb = "PATCH"
)

type Rest

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

rest is a wrapper over restclient library

func REST

func REST(base string) (r *Rest, err error)

REST provides a new instance of rest client capable of invoking REST API calls

NOTE: base url can be of form http://ipaddr:port with no trailing slash

func (*Rest) Do

func (r *Rest) Do() (res interface{}, err error)

func (*Rest) WithBody

func (r *Rest) WithBody(o interface{}) (u *Rest)

func (*Rest) WithName

func (r *Rest) WithName(n string) (u *Rest)

func (*Rest) WithVerb

func (r *Rest) WithVerb(v HttpVerb) (u *Rest)

Jump to

Keyboard shortcuts

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