# README
service
import "github.com/coralproject/shelf/cmd/corald/service"
Overview
Index
- Variables
- func GetItemByID(c *web.Context, itemID string) (*item.Item, error)
- func Rewrite(c *web.Context) func(*http.Request)
- func RewritePath(c *web.Context, targetPath string) func(*http.Request)
- func SignServiceRequest(context interface{}, signer auth.Signer, r *http.Request) error
- func UpsertItem(c *web.Context, itm *item.Item) error
Package files
Variables
var (
// ErrItemNotFound is when the item is not found.
ErrItemNotFound = errors.New("Item not found")
// ErrNotAnItem is returned when the interface{} is not an Item{}.
ErrNotAnItem = errors.New("Not an item")
// ErrServiceNotSet is returned when the URL for the service is not setup.
ErrServiceNotSet = errors.New("Service Sponged not found")
)
func GetItemByID
func GetItemByID(c *web.Context, itemID string) (*item.Item, error)
GetItemByID returns an item based on its item_id.
func Rewrite
func Rewrite(c *web.Context) func(*http.Request)
Rewrite will add service request headers to the request and add other standards.
func RewritePath
func RewritePath(c *web.Context, targetPath string) func(*http.Request)
RewritePath will rewrite the path given a PathRewriter and return the request director function.
func SignServiceRequest
func SignServiceRequest(context interface{}, signer auth.Signer, r *http.Request) error
SignServiceRequest signs a request with the claims necessary to authenticate with downstream services.
func UpsertItem
func UpsertItem(c *web.Context, itm *item.Item) error
UpsertItem upserts an item
Generated by godoc2md