store

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

README

store

DB

Yugabyte

CREATE KEYSPACE IF NOT EXISTS argus;
CREATE TABLE argus.gifnoc (
    bucket VARCHAR,
    id VARCHAR,
    data blob,
    PRIMARY KEY (bucket, id))
    WITH default_time_to_live = 300
    AND transactions = {'enabled': 'false'};

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 DefaultTTL = 60 * 5

5 minutes

Variables

View Source
var (
	ErrNoBucketVariable = errors.New("No bucket variable in URI definition")
)

Functions

func FilterOwner added in v0.2.0

func FilterOwner(value map[string]OwnableItem, owner string) map[string]OwnableItem

func NewGetAllEndpoint

func NewGetAllEndpoint(s S) endpoint.Endpoint

func NewGetEndpoint

func NewGetEndpoint(s S) endpoint.Endpoint

func NewSetEndpoint

func NewSetEndpoint(s S) endpoint.Endpoint

Types

type BadRequestError

type BadRequestError struct {
	Request interface{}
}

func (BadRequestError) Error

func (bre BadRequestError) Error() string

func (BadRequestError) StatusCode

func (bre BadRequestError) StatusCode() int

type Handler

type Handler http.Handler

func NewHandler

func NewHandler(e endpoint.Endpoint) Handler

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

type KeyNotFoundError struct {
	Key model.Key
}

func (KeyNotFoundError) Error

func (knfe KeyNotFoundError) Error() string

func (KeyNotFoundError) StatusCode

func (knfe KeyNotFoundError) StatusCode() int

type OwnableItem added in v0.2.0

type OwnableItem struct {
	model.Item

	Owner string `json:"owner"`
}

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 StoreIn

type StoreIn struct {
	fx.In

	Store S
}

StoreIn is the set of dependencies for this package's components

type StoreOut

type StoreOut struct {
	fx.Out

	// SetKeyHandler is the http.Handler which can update the Registry
	SetKeyHandler Handler `name:"setHandler"`

	// SetKeyHandler is the http.Handler which can update the Registry
	GetKeyHandler Handler `name:"getHandler"`

	// SetKeyHandler is the http.Handler which can update the Registry
	AllKeyHandler Handler `name:"getAllHandler"`
}

StoreOut is the set of components emitted by this package

func Provide

func Provide(in StoreIn) StoreOut

Provide is an uber/fx style provider for this package's components

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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