Documentation ¶
Index ¶
- Variables
- type DynamoClient
- func (d *DynamoClient) AddHeart(key string) (*pb.HeartCount, error)
- func (d *DynamoClient) CreateTables() error
- func (d *DynamoClient) CreateTablesIfNotExists()
- func (d *DynamoClient) DeleteTables() error
- func (d *DynamoClient) ForEachFood(startDate *string, endDate *string, fn func(*pb.Food)) error
- func (d *DynamoClient) GetHearts(keys []string) (*[]*pb.HeartCount, error)
- func (d *DynamoClient) GetProto(table string, keys map[string]string, p proto.Message) error
- func (d *DynamoClient) PutProto(table *string, p proto.Message) error
- func (d *DynamoClient) PutProtoBatch(table *string, protos []proto.Message) error
- func (d *DynamoClient) QueryDiningHalls() (*pb.DiningHalls, error)
- func (d *DynamoClient) QueryFoodStats() (*[]*pb.FoodStat, error)
- func (d *DynamoClient) QueryFoods(name *string, date *string) (*[]*pb.Food, error)
- func (d *DynamoClient) QueryFoodsDateRange(name *string, startDate *string, endDate *string) (*[]*pb.Food, error)
- func (d *DynamoClient) QueryMenus(diningHallName *string, date *string, meal *string) (*[]*pb.Menu, error)
- func (d *DynamoClient) StreamHearts() (chan pb.HeartCount, chan struct{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DiningHallsTableName = "DiningHalls" ItemsTableName = "Items" MenuTableName = "Menus" FoodTableName = "Foods" FoodStatsTableName = "FoodStats" HeartsTableName = "Hearts" )
View Source
var ( NameKey = "name" DiningHallDateMealKey = "key" DateKey = "date" NameDateKey = "key" FoodTableNameKey = "key" MenuTableDiningHallMealKey = "diningHallMeal" FoodStatsDateKey = "date" HeartsTableKey = "key" )
View Source
var ( TableNames = []string{ DiningHallsTableName, ItemsTableName, MenuTableName, FoodTableName, FoodStatsTableName, HeartsTableName} TableKeys = map[string][]dynamodb.KeySchemaElement{ DiningHallsTableName: []dynamodb.KeySchemaElement{ dynamodb.KeySchemaElement{ AttributeName: &NameKey, KeyType: "HASH"}}, ItemsTableName: []dynamodb.KeySchemaElement{ dynamodb.KeySchemaElement{ AttributeName: &NameKey, KeyType: "HASH"}}, MenuTableName: []dynamodb.KeySchemaElement{ dynamodb.KeySchemaElement{ AttributeName: &DateKey, KeyType: "HASH"}, dynamodb.KeySchemaElement{ AttributeName: &MenuTableDiningHallMealKey, KeyType: "RANGE"}}, FoodTableName: []dynamodb.KeySchemaElement{ dynamodb.KeySchemaElement{ AttributeName: &FoodTableNameKey, KeyType: "HASH"}, dynamodb.KeySchemaElement{ AttributeName: &DateKey, KeyType: "RANGE"}}, FoodStatsTableName: []dynamodb.KeySchemaElement{ dynamodb.KeySchemaElement{ AttributeName: &FoodStatsDateKey, KeyType: "HASH", }}, HeartsTableName: []dynamodb.KeySchemaElement{ dynamodb.KeySchemaElement{ AttributeName: &HeartsTableKey, KeyType: "HASH", }}} TableAttributes = map[string][]dynamodb.AttributeDefinition{ DiningHallsTableName: []dynamodb.AttributeDefinition{ dynamodb.AttributeDefinition{ AttributeName: &NameKey, AttributeType: dynamodb.ScalarAttributeTypeS}}, ItemsTableName: []dynamodb.AttributeDefinition{ dynamodb.AttributeDefinition{ AttributeName: &NameKey, AttributeType: dynamodb.ScalarAttributeTypeS}}, MenuTableName: []dynamodb.AttributeDefinition{ dynamodb.AttributeDefinition{ AttributeName: &DateKey, AttributeType: dynamodb.ScalarAttributeTypeS}, dynamodb.AttributeDefinition{ AttributeName: &MenuTableDiningHallMealKey, AttributeType: dynamodb.ScalarAttributeTypeS}}, FoodTableName: []dynamodb.AttributeDefinition{ dynamodb.AttributeDefinition{ AttributeName: &FoodTableNameKey, AttributeType: dynamodb.ScalarAttributeTypeS}, dynamodb.AttributeDefinition{ AttributeName: &DateKey, AttributeType: dynamodb.ScalarAttributeTypeS}}, FoodStatsTableName: []dynamodb.AttributeDefinition{ dynamodb.AttributeDefinition{ AttributeName: &FoodStatsDateKey, AttributeType: dynamodb.ScalarAttributeTypeS}}, HeartsTableName: []dynamodb.AttributeDefinition{ dynamodb.AttributeDefinition{ AttributeName: &HeartsTableKey, AttributeType: dynamodb.ScalarAttributeTypeS}}} TableStreamSpecs = map[string]dynamodb.StreamSpecification{ DiningHallsTableName: dynamodb.StreamSpecification{StreamEnabled: &falseValue, StreamViewType: dynamodb.StreamViewTypeNewImage}, ItemsTableName: dynamodb.StreamSpecification{StreamEnabled: &falseValue, StreamViewType: dynamodb.StreamViewTypeNewImage}, MenuTableName: dynamodb.StreamSpecification{StreamEnabled: &falseValue, StreamViewType: dynamodb.StreamViewTypeNewImage}, FoodTableName: dynamodb.StreamSpecification{StreamEnabled: &falseValue, StreamViewType: dynamodb.StreamViewTypeNewImage}, FoodStatsTableName: dynamodb.StreamSpecification{StreamEnabled: &falseValue, StreamViewType: dynamodb.StreamViewTypeNewImage}, HeartsTableName: dynamodb.StreamSpecification{StreamEnabled: &trueValue, StreamViewType: dynamodb.StreamViewTypeNewImage}, } )
Functions ¶
This section is empty.
Types ¶
type DynamoClient ¶
type DynamoClient struct {
// contains filtered or unexported fields
}
func New ¶
func New() *DynamoClient
func (*DynamoClient) AddHeart ¶
func (d *DynamoClient) AddHeart(key string) (*pb.HeartCount, error)
func (*DynamoClient) CreateTables ¶
func (d *DynamoClient) CreateTables() error
func (*DynamoClient) CreateTablesIfNotExists ¶
func (d *DynamoClient) CreateTablesIfNotExists()
func (*DynamoClient) DeleteTables ¶
func (d *DynamoClient) DeleteTables() error
func (*DynamoClient) ForEachFood ¶
func (*DynamoClient) GetHearts ¶
func (d *DynamoClient) GetHearts(keys []string) (*[]*pb.HeartCount, error)
func (*DynamoClient) PutProto ¶
func (d *DynamoClient) PutProto(table *string, p proto.Message) error
func (*DynamoClient) PutProtoBatch ¶
func (d *DynamoClient) PutProtoBatch(table *string, protos []proto.Message) error
func (*DynamoClient) QueryDiningHalls ¶
func (d *DynamoClient) QueryDiningHalls() (*pb.DiningHalls, error)
func (*DynamoClient) QueryFoodStats ¶
func (d *DynamoClient) QueryFoodStats() (*[]*pb.FoodStat, error)
func (*DynamoClient) QueryFoods ¶
func (*DynamoClient) QueryFoodsDateRange ¶
func (*DynamoClient) QueryMenus ¶
func (*DynamoClient) StreamHearts ¶
func (d *DynamoClient) StreamHearts() (chan pb.HeartCount, chan struct{})
Click to show internal directories.
Click to hide internal directories.