Documentation ¶
Index ¶
Constants ¶
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 ¶
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 (*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