clientbase

package
v0.0.0-...-cad01ba Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SELF       = "self"
	COLLECTION = "collection"
)

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

func NewListOpts

func NewListOpts() *types.ListOpts

Types

type APIBaseClient

type APIBaseClient struct {
	Ops   *APIOperations
	Opts  *ClientOpts
	Types map[string]types.Schema
}

func NewAPIClient

func NewAPIClient(opts *ClientOpts) (APIBaseClient, error)

func (*APIBaseClient) Action

func (a *APIBaseClient) Action(schemaType string, action string,
	existing *types.Resource, inputObject, respObject interface{}) error

func (*APIBaseClient) ByID

func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error

func (*APIBaseClient) Create

func (a *APIBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error

func (*APIBaseClient) Delete

func (a *APIBaseClient) Delete(existing *types.Resource) error
func (a *APIBaseClient) GetLink(resource types.Resource, link string, respObject interface{}) error

func (*APIBaseClient) List

func (a *APIBaseClient) List(schemaType string, opts *types.ListOpts, respObject interface{}) error

func (*APIBaseClient) Post

func (a *APIBaseClient) Post(url string, createObj interface{}, respObject interface{}) error

func (*APIBaseClient) Reload

func (a *APIBaseClient) Reload(existing *types.Resource, output interface{}) error

func (*APIBaseClient) Update

func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error

func (*APIBaseClient) Websocket

func (a *APIBaseClient) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error)

type APIError

type APIError struct {
	StatusCode int
	URL        string
	Msg        string
	Status     string
	Body       string
}

func (*APIError) Error

func (e *APIError) Error() string

type APIOperations

type APIOperations struct {
	Opts   *ClientOpts
	Types  map[string]types.Schema
	Client *http.Client
}

func (*APIOperations) DoAction

func (a *APIOperations) DoAction(schemaType string, action string,
	existing *types.Resource, inputObject, respObject interface{}) error

func (*APIOperations) DoByID

func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error

func (*APIOperations) DoCreate

func (a *APIOperations) DoCreate(schemaType string, createObj interface{}, respObject interface{}) error

func (*APIOperations) DoDelete

func (a *APIOperations) DoDelete(url string) error

func (*APIOperations) DoGet

func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject interface{}) error

func (*APIOperations) DoList

func (a *APIOperations) DoList(schemaType string, opts *types.ListOpts, respObject interface{}) error

func (*APIOperations) DoModify

func (a *APIOperations) DoModify(method string, url string, createObj interface{}, respObject interface{}) error

func (*APIOperations) DoNext

func (a *APIOperations) DoNext(nextUrl string, respObject interface{}) error

func (*APIOperations) DoResourceDelete

func (a *APIOperations) DoResourceDelete(schemaType string, existing *types.Resource) error

func (*APIOperations) DoUpdate

func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error

type ClientOpts

type ClientOpts struct {
	URL        string
	AccessKey  string
	SecretKey  string
	Timeout    time.Duration
	HTTPClient *http.Client
}

type ObjectClient

type ObjectClient struct {
	Factory ObjectFactory
	// contains filtered or unexported fields
}

func NewObjectClient

func NewObjectClient(namespace string, restClient rest.Interface, apiResource *metav1.APIResource, gvk schema.GroupVersionKind, factory ObjectFactory) *ObjectClient

func (*ObjectClient) Create

func (p *ObjectClient) Create(o runtime.Object) (runtime.Object, error)

func (*ObjectClient) Delete

func (p *ObjectClient) Delete(name string, opts *metav1.DeleteOptions) error

func (*ObjectClient) DeleteCollection

func (p *ObjectClient) DeleteCollection(deleteOptions *metav1.DeleteOptions, listOptions metav1.ListOptions) error

func (*ObjectClient) Get

func (p *ObjectClient) Get(name string, opts metav1.GetOptions) (runtime.Object, error)

func (*ObjectClient) List

func (*ObjectClient) Update

func (p *ObjectClient) Update(name string, o runtime.Object) (runtime.Object, error)

func (*ObjectClient) Watch

func (p *ObjectClient) Watch(opts metav1.ListOptions) (watch.Interface, error)

type ObjectFactory

type ObjectFactory interface {
	Object() runtime.Object
	List() runtime.Object
}

Jump to

Keyboard shortcuts

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