Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TypeLabel is for labeling metrics; if there is a single metric for // successful queries, the typeLabel and corresponding type can be used // when incrementing the metric. TypeLabel = "type" InsertType = "insert" DeleteType = "delete" ReadType = "read" PingType = "ping" )
View Source
const ( ItemOwnerHeaderKey = "X-Midt-Owner" AdminTokenHeaderKey = "X-Midt-Admin-Token" XmidtErrorHeaderKey = "X-Midt-Error" )
Request and Response Headers
View Source
const DefaultTTL = 60 * 5
5 minutes
View Source
const YearTTL = 60 * 24 * 365
1 year
Variables ¶
View Source
var ErrCasting = errors.New("casting error due to middleware wiring mistake")
ErrCasting indicates there was a middleware wiring mistake with the go-kit style encoders.
Functions ¶
func FilterOwner ¶ added in v0.2.0
func FilterOwner(value map[string]OwnableItem, owner string) map[string]OwnableItem
Types ¶
type BadRequestErr ¶ added in v0.3.6
type BadRequestErr struct {
Message string
}
func (BadRequestErr) Error ¶ added in v0.3.6
func (bre BadRequestErr) Error() string
func (BadRequestErr) StatusCode ¶ added in v0.3.6
func (bre BadRequestErr) StatusCode() int
type ForbiddenRequestErr ¶ added in v0.3.8
type ForbiddenRequestErr struct {
Message string
}
func (ForbiddenRequestErr) Error ¶ added in v0.3.8
func (f ForbiddenRequestErr) Error() string
func (ForbiddenRequestErr) StatusCode ¶ added in v0.3.8
func (f ForbiddenRequestErr) StatusCode() int
type InternalError ¶ added in v0.2.1
type InternalError struct { Reason interface{} Retryable bool }
func (InternalError) Error ¶ added in v0.2.1
func (ie InternalError) Error() string
func (InternalError) StatusCode ¶ added in v0.2.1
func (ie InternalError) StatusCode() int
type KeyItemPairRequest ¶ added in v0.2.0
type KeyItemPairRequest struct { model.Key OwnableItem Method string }
type KeyNotFoundError ¶
func (KeyNotFoundError) Error ¶
func (knfe KeyNotFoundError) Error() string
func (KeyNotFoundError) StatusCode ¶
func (knfe KeyNotFoundError) StatusCode() int
type OwnableItem ¶ added in v0.2.0
type S ¶
type S interface { Push(key model.Key, item OwnableItem) error Get(key model.Key) (OwnableItem, error) Delete(key model.Key) (OwnableItem, error) GetAll(bucket string) (map[string]OwnableItem, error) }
type StoreOut ¶
type StoreOut struct { fx.Out // SetItemHandler is the http.Handler to update an item in the store. SetItemHandler Handler `name:"setHandler"` // SetKeyHandler is the http.Handler to fetch an individual item from the store. GetItemHandler Handler `name:"getHandler"` // GetAllItems is the http.Handler to fetch all items from the store for a given bucket. GetAllItemsHandler Handler `name:"getAllHandler"` // DeletItems is the http.Handler to delete a certain item. DeleteKeyHandler Handler `name:"deleteHandler"` }
StoreOut is the set of components emitted by this package
Source Files ¶
Click to show internal directories.
Click to hide internal directories.