service

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 7 Imported by: 1

README

service

import "github.com/coralproject/shelf/cmd/corald/service"

Overview

Index

Package files

service.go sponge.go

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)

Functions

func GetItemByID added in v0.4.3

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 added in v0.4.2

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 added in v0.4.3

func UpsertItem(c *web.Context, itm *item.Item) error

UpsertItem upserts an item

Types

This section is empty.

Jump to

Keyboard shortcuts

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