store

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 19 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 (
	BucketFormatRegexSource = "^[0-9a-z][0-9a-z-]{1,61}[0-9a-z]$"
	OwnerFormatRegexSource  = "^.{10,60}$"
)

default input field validation regular expressions. Note: these values are configurable so please check the argus.yaml file if you're interested.

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"
	XmidtErrorHeaderKey = "X-Midt-Error"
)

Request and Response Headers.

View Source
const ElevatedAccessLevel = 1

ElevatedAccessLevel is the bascule attribute value found in requests that should be granted priviledged access to operations.

View Source
const IDFormatRegexSource = "^[0-9a-f]{64}$"

IDFormatRegexSource helps validate the ID on incoming requests.

Variables

View Source
var ErrCasting = errors.New("casting error due to middleware wiring mistake")

ErrCasting indicates there was (most likely) a middleware wiring mistake with the go-kit style encoders/decoders.

Functions

func FilterOwner added in v0.2.0

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

func ProvideHandlers added in v0.3.10

func ProvideHandlers() fx.Option

ProvideHandlers fetches all dependencies and builds the four main handlers for this store.

func Sha256HexDigest added in v0.3.10

func Sha256HexDigest(message string) string

Sha256HexDigest returns the SHA-256 hex digest of the given input.

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 Handler

type Handler http.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)
}

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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