コード例 #1
0
func comfirmSessionTableExists() (found bool, err error) {
	if _, err := aws.DynamoTable(sessionTable); err == nil {
		return true, nil
	}
	logs.Debug.Print("[model] Session table was not found. Try to make it. @aws.DynamoCreateTable")
	attributes := map[string]string{
		"ID": "S",
	}
	keys := map[string]string{
		"ID": "HASH",
	}
	_, err = aws.DynamoCreateTable(sessionTable, attributes, keys, 1, 1)
	return false, err
}
コード例 #2
0
ファイル: cron.go プロジェクト: supinf/reinvent-sessions-api
func comfirmCronTableExists() error {
	if _, err := aws.DynamoTable(cronTable); err == nil {
		return nil
	}
	logs.Debug.Print("[model] Cron table was not found. Try to make it. @aws.DynamoCreateTable")
	attributes := map[string]string{
		"Key": "S",
	}
	keys := map[string]string{
		"Key": "HASH",
	}
	_, err := aws.DynamoCreateTable(cronTable, attributes, keys, 1, 1)
	return err
}