ds

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceID is the id of the datastore service
	ServiceID = "io.stellarproject.atlas.datastore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	// ID returns the id of the datastore
	ID() string
	// Get gets the specified records by key
	Get(key string) ([]*api.Record, error)
	// Set sets the key to the records
	Set(key string, v []*api.Record) error
	// Search returns a list of records optionally filtered
	Search(key string, filters ...Filter) ([]*api.Record, error)
	// Delete deletes records by key
	Delete(key string) error
	// Close optionally closes any resources in use by the datastore
	Close() error
	// Export exports all data from the datastore
	Export() ([]byte, error)
}

Datastore defines the datastore interface

type Filter

type Filter interface {
	// Apply is the implementation needed to filter records
	Apply(r []*api.Record) ([]*api.Record, error)
}

Filter allows for filtering of records

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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