store

package
v0.0.0-...-0dfd57a Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("Document not found.")
	ErrNoReply  = errors.New("no reply received.")
)

Functions

This section is empty.

Types

type Command

type Command struct {
	Type  string      `json:"type"`
	Key   string      `json:"key"`
	Value interface{} `json:"value,omitempty"`
}

type Document

type Document struct {
	Collection string `json:"collection"`
	Key        string `json:"key"`
	Value      []byte `json:"value,omitempty"`
}

type Scan

type Scan struct {
	Prefix  string `json:"prefix,omitempty"`
	Start   string `json:"start,omitempty"`
	End     string `json:"end,omitempty"`
	Only    string `json:"only,omitempty"`
	Limit   int    `json:"limit,omitempty"`
	Reverse bool   `json:"reverse,omitempty"`

	Filter interface{} `json:"filter,omitempty"`
}

type Store

type Store struct {
	StoreName string
	// contains filtered or unexported fields
}

func New

func New(c sarif.Client) *Store

func (*Store) Batch

func (s *Store) Batch(p []Command, result interface{}) error

func (*Store) Get

func (s *Store) Get(key string, result interface{}) error

func (*Store) Put

func (s *Store) Put(key string, doc interface{}) (*Document, error)

func (*Store) PutTriple

func (st *Store) PutTriple(collection string, t Triple) error

func (*Store) Scan

func (s *Store) Scan(key string, p Scan, result interface{}) error

func (*Store) ScanTriple

func (st *Store) ScanTriple(collection string, t Triple, scan Scan, result interface{}) error

type Triple

type Triple interface {
	Triple() (s, p, o string)
}

Jump to

Keyboard shortcuts

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