db

package
v0.0.0-...-dafb618 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AliasesKey    = "aliases"
	CandidatesKey = "candidates"
	GlossaryKey   = "glossary"
	InterviewsKey = "interviews"
	KarmasKey     = "karmas"
	TriviaKey     = "trivia"
)

Keys used for reading & writing data in Stores

Variables

This section is empty.

Functions

func Init

func Init(store Store) error

Init will initialize the table entries for the specified store

Types

type DynamoDBStore

type DynamoDBStore struct {
	// contains filtered or unexported fields
}

DynamoDBStore reads and writes data to a DynamoDB table

func NewDynamoDBStore

func NewDynamoDBStore(session *session.Session, table string) *DynamoDBStore

NewDynamoDBStore creates a new DynamoDBStore for the specified table

func (*DynamoDBStore) Keys

func (d *DynamoDBStore) Keys() ([]string, error)

Keys lists all of the keys in the store

func (*DynamoDBStore) Read

func (d *DynamoDBStore) Read(key string, v interface{}) error

Read will populate v with the entry at the specified key

func (*DynamoDBStore) Write

func (d *DynamoDBStore) Write(key string, v interface{}) error

Write will populate the entry at the specified key with v

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

MemoryStore reads and writes data to memory

func NewMemoryStore

func NewMemoryStore() *MemoryStore

NewMemoryStore creates a new MemoryStore

func (*MemoryStore) Keys

func (m *MemoryStore) Keys() ([]string, error)

Keys lists all of the keys in the store

func (*MemoryStore) Read

func (m *MemoryStore) Read(key string, v interface{}) error

Read will populate v with the entry at the specified key

func (*MemoryStore) Write

func (m *MemoryStore) Write(key string, v interface{}) error

Write will write v at the specified key

type MissingEntryError

type MissingEntryError error

MissingEntryError occurs when a Read operation runs with a key that has no corresponding entry

func NewMissingEntryError

func NewMissingEntryError(key string) MissingEntryError

NewMissingEntryError creates a new MissingEntryError object

type Store

type Store interface {
	// Keys lists all of the keys in the store
	Keys() ([]string, error)

	// Read will read the value at the specified key into v
	Read(key string, v interface{}) error

	// Write will write v at the specified key
	Write(key string, v interface{}) error
}

Store objects are used to read and write data

Jump to

Keyboard shortcuts

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