handlers

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMeta

func CheckMeta(resource interface{}, vars map[string]string) error

CheckMeta inspects the resource metadata and ensures it matches what was specified in the request URL

Types

type Handlers

type Handlers struct {
	Resource corev2.Resource
	Store    store.ResourceStore
}

Handlers represents the HTTP handlers for CRUD operations on resources

func (Handlers) CreateOrUpdateResource

func (h Handlers) CreateOrUpdateResource(r *http.Request) (interface{}, error)

CreateOrUpdateResource creates or updates the resource given in the request body, regardless of whether it already exists or not

func (Handlers) CreateResource

func (h Handlers) CreateResource(r *http.Request) (interface{}, error)

CreateResource creates the resource given in the request body but only if it does not already exist

func (Handlers) DeleteResource

func (h Handlers) DeleteResource(r *http.Request) (interface{}, error)

DeleteResource deletes the resources identified in the request path

func (Handlers) GetResource

func (h Handlers) GetResource(r *http.Request) (interface{}, error)

GetResource retrieves the resource identified in the request path

func (Handlers) ListResources

func (h Handlers) ListResources(ctx context.Context, pred *store.SelectionPredicate) ([]corev2.Resource, error)

ListResources lists all resources for the resource type

Jump to

Keyboard shortcuts

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