Пример #1
0
// GetSession retrives a specified session from DynamoDB
//  @param  id string
//  @return session models.Session
func GetSession(id string) (session Session, err error) {
	record, err := aws.DynamoRecord(sessionTable, map[string]*dynamodb.AttributeValue{
		"ID": aws.DynamoAttributeS(id),
	})
	if err != nil {
		return session, nil
	}
	return toSession(record), nil
}
Пример #2
0
// GetCronResult retrives a specified cron result from DynamoDB
//  @return session models.Session
func GetCronResult(key string) (result CronResult, err error) {
	record, err := aws.DynamoRecord(cronTable, map[string]*dynamodb.AttributeValue{
		"Key": aws.DynamoAttributeS(key),
	})
	if err != nil {
		return result, nil
	}
	return toCronResult(record), nil
}