Exemplo n.º 1
0
func toCronResult(record map[string]*dynamodb.AttributeValue) CronResult {
	result := CronResult{}
	result.Key = aws.DynamoS(record, "Key")
	result.Memo = aws.DynamoS(record, "Memo")
	result.LastStartDate = misc.StringToTime(aws.DynamoS(record, "LastStartDate"))
	result.LastEndDate = misc.StringToTime(aws.DynamoS(record, "LastEndDate"))
	return result
}
Exemplo n.º 2
0
// cast DynamoDB record to a Session
func toSession(record map[string]*dynamodb.AttributeValue) Session {
	session := Session{}
	session.ID = aws.DynamoS(record, "ID")
	session.Abbreviation = aws.DynamoS(record, "Abbreviation")
	session.Title = aws.DynamoS(record, "Title")
	session.Abstract = aws.DynamoS(record, "Abstract")
	// session.Recommended = aws.DynamoB(record, "Recommended")

	// FIXME http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html
	// session.Speakers = []string{}
	session.Date = aws.DynamoN64(record, "Date")
	session.Start = aws.DynamoD(record, "Start")
	session.End = aws.DynamoD(record, "End")
	session.Room = aws.DynamoS(record, "Room")
	session.Length = aws.DynamoS(record, "Length")
	session.TypeID = aws.DynamoN(record, "TypeId")
	session.Type = aws.DynamoS(record, "Type")
	session.TrackID = aws.DynamoN(record, "TrackId")
	session.Track = aws.DynamoS(record, "Track")
	session.LevelID = aws.DynamoN(record, "LevelId")
	session.Level = aws.DynamoS(record, "Level")
	return session
}