Documentation ¶
Index ¶
- type Config
- type DB
- func (d DB) CreateTables(ctx context.Context) error
- func (d DB) DeleteSimpleThing(ctx context.Context, name string) error
- func (d DB) DeleteThing(ctx context.Context, name string, version int64) error
- func (d DB) DeleteThingWithDateRange(ctx context.Context, name string, date strfmt.DateTime) error
- func (d DB) GetSimpleThing(ctx context.Context, name string) (*models.SimpleThing, error)
- func (d DB) GetThing(ctx context.Context, name string, version int64) (*models.Thing, error)
- func (d DB) GetThingWithDateRange(ctx context.Context, name string, date strfmt.DateTime) (*models.ThingWithDateRange, error)
- func (d DB) SaveSimpleThing(ctx context.Context, m models.SimpleThing) error
- func (d DB) SaveThing(ctx context.Context, m models.Thing) error
- func (d DB) SaveThingWithDateRange(ctx context.Context, m models.ThingWithDateRange) error
- type SimpleThingTable
- type ThingTable
- type ThingWithDateRangeTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // DynamoDBAPI is used to communicate with DynamoDB. It is required. // It can be overriden on a table-by-table basis. DynamoDBAPI dynamodbiface.DynamoDBAPI // DefaultPrefix configures a prefix on all table names. It is required. // It can be overriden on a table-by-table basis. DefaultPrefix string // DefaultWriteCapacityUnits configures a default write capacity when creating tables. It defaults to 1. // It can be overriden on a table-by-table basis. DefaultWriteCapacityUnits int64 // DefaultReadCapacityUnits configures a default read capacity when creating tables. It defaults to 1. // It can be overriden on a table-by-table basis. DefaultReadCapacityUnits int64 // SimpleThingTable configuration. SimpleThingTable SimpleThingTable // ThingTable configuration. ThingTable ThingTable // ThingWithDateRangeTable configuration. ThingWithDateRangeTable ThingWithDateRangeTable }
Config is used to create a new DB struct.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements the database interface using DynamoDB to store data.
func (DB) CreateTables ¶
CreateTables creates all tables.
func (DB) DeleteSimpleThing ¶
DeleteSimpleThing deletes a SimpleThing from the database.
func (DB) DeleteThing ¶
DeleteThing deletes a Thing from the database.
func (DB) DeleteThingWithDateRange ¶
DeleteThingWithDateRange deletes a ThingWithDateRange from the database.
func (DB) GetSimpleThing ¶
GetSimpleThing retrieves a SimpleThing from the database.
func (DB) GetThingWithDateRange ¶
func (d DB) GetThingWithDateRange(ctx context.Context, name string, date strfmt.DateTime) (*models.ThingWithDateRange, error)
GetThingWithDateRange retrieves a ThingWithDateRange from the database.
func (DB) SaveSimpleThing ¶
SaveSimpleThing saves a SimpleThing to the database.
func (DB) SaveThingWithDateRange ¶
SaveThingWithDateRange saves a ThingWithDateRange to the database.
type SimpleThingTable ¶
type SimpleThingTable struct { DynamoDBAPI dynamodbiface.DynamoDBAPI Prefix string ReadCapacityUnits int64 WriteCapacityUnits int64 }
SimpleThingTable represents the user-configurable properties of the SimpleThing table.
type ThingTable ¶
type ThingTable struct { DynamoDBAPI dynamodbiface.DynamoDBAPI Prefix string ReadCapacityUnits int64 WriteCapacityUnits int64 }
ThingTable represents the user-configurable properties of the Thing table.
type ThingWithDateRangeTable ¶
type ThingWithDateRangeTable struct { DynamoDBAPI dynamodbiface.DynamoDBAPI Prefix string ReadCapacityUnits int64 WriteCapacityUnits int64 }
ThingWithDateRangeTable represents the user-configurable properties of the ThingWithDateRange table.