func (d *dao) GetSecretRecord(namespace string, serial int64) (*SecretRecord, error) {
	key := map[string]*dynamodb.AttributeValue{
		"Name": {
			S: aws.String(namespace),
		},
		"Serial": {
			N: aws.String(strconv.FormatInt(serial, 10)),
		},
	}

	itemResult, err := d.dynamodbClient.GetItem(&dynamodb.GetItemInput{
		TableName: aws.String(cfnclient.GetSecretsTableName(d.appName)),
		Key:       key,
	})

	if err != nil {
		return nil, err
	}

	if itemResult == nil || itemResult.Item == nil || len(itemResult.Item) == 0 {
		return nil, fmt.Errorf("Secret record not found in the data store")
	}

	loadedSecret := &SecretRecord{}
	err = dynamodbattribute.UnmarshalMap(itemResult.Item, loadedSecret)

	if err != nil {
		return nil, err
	}

	return loadedSecret, nil
}
// GetSecretRecord gets a secret record from DynamoDB
GetSecretRecord gets a secret record from DynamoDB
// GetSecretRecord gets a secret record from DynamoDB
func (d *dao) GetSecretRecord(namespace string, serial int64) (*SecretRecord, error) {
	key := map[string]*dynamodb.AttributeValue{
		"Name": {
			S: aws.String(namespace),
		},
		"Serial": {
			N: aws.String(strconv.FormatInt(serial, 10)),
		},
	}
	itemResult, err := d.dynamodbClient.GetItem(&dynamodb.GetItemInput{
		TableName: aws.String(cfnclient.GetSecretsTableName(d.appName)),
		Key:       key,
	})
	if err != nil {
		return nil, err
	}
	if itemResult == nil || itemResult.Item == nil || len(itemResult.Item) == 0 {
		return nil, fmt.Errorf("Secret record not found in the data store")
	}
	loadedSecret := &SecretRecord{}
	err = dynamodbattribute.UnmarshalMap(itemResult.Item, loadedSecret)
	if err != nil {
		return nil, err
	}
	return loadedSecret, nil
}
func ( d * dao ) GetSecretRecord ( namespace string , serial int64 ) ( * SecretRecord , error ) { key := map [ string ] * dynamodb . AttributeValue { " " : { S : aws . String ( namespace ) , } , " " : { N : aws . String ( strconv . FormatInt ( serial , 10 ) ) , } , } itemResult , err := d . dynamodbClient . GetItem ( & dynamodb . GetItemInput { TableName : aws . String ( cfnclient . GetSecretsTableName ( d . appName ) ) , Key : key , } ) if err != nil { return nil , err } if itemResult == nil || itemResult . Item == nil || len ( itemResult . Item ) == 0 { return nil , fmt . Errorf ( " " ) } loadedSecret := & SecretRecord { } err = dynamodbattribute . UnmarshalMap ( itemResult . Item , loadedSecret ) if err != nil { return nil , err } return loadedSecret , nil }
GetSecretRecord gets a secret record from DynamoDB
GetSecretRecord gets a secret record from DynamoDB