methods

package
v0.0.0-...-0fda810 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, deleterFunc deleteItem, r *mux.Router, log logger.Logger)

Delete provides an API endpoint used to delete an intem

func Get

func Get(ctx context.Context, getterFunc get, r *mux.Router, log logger.Logger)

Get returns a single instance of an item based on the ID in the path

func List

func List(ctx context.Context, listFunc list, r *mux.Router, log logger.Logger)

List reponds to a HTTP Get request for a collection

func Post

func Post(ctx context.Context, createFunc create, getUser extractUserName, r *mux.Router, log logger.Logger)

Post reponds to a HTTP Post request to a collection

func Put

func Put(ctx context.Context, updateFunc updateItem, getUser extractUserName, r *mux.Router, log logger.Logger)

Put provides an API endpoint used to update an intem

Types

type ItemList

type ItemList struct {
	Count int           `json:"count"`
	Items []interface{} `json:"items"`
}

ItemList formats the collection get response to a list

Jump to

Keyboard shortcuts

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