Documentation ¶
Index ¶
- func GetConnection(config *aws.Config) *dynamodb.DynamoDB
- func NewMockSSM(path string, mapItem map[string]interface{}) *mockSSM
- func NewSSMSession(region string) ssmiface.SSMAPI
- type DynamoDBRepo
- func (repo *DynamoDBRepo) Delete(key string) error
- func (repo *DynamoDBRepo) Find(key string) (repository.KeyValuePair, error)
- func (repo *DynamoDBRepo) FindAll() ([]repository.KeyValuePair, error)
- func (repo *DynamoDBRepo) Overwrite(key string, in interface{}) (repository.KeyValuePair, error)
- func (repo *DynamoDBRepo) Save(key string, in interface{}) (repository.KeyValuePair, error)
- type SSMParameterStoreRepo
- func (repo *SSMParameterStoreRepo) Delete(key string) error
- func (repo *SSMParameterStoreRepo) Find(key string) (repository.KeyValuePair, error)
- func (repo *SSMParameterStoreRepo) FindAll() ([]repository.KeyValuePair, error)
- func (repo *SSMParameterStoreRepo) Overwrite(key string, in interface{}) (repository.KeyValuePair, error)
- func (repo *SSMParameterStoreRepo) Save(key string, in interface{}) (repository.KeyValuePair, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConnection ¶
GetConnection takes a configuration, creates a session and returns a connection the assoicated dynamodb
func NewMockSSM ¶
func NewSSMSession ¶
Types ¶
type DynamoDBRepo ¶
type DynamoDBRepo struct {
// contains filtered or unexported fields
}
DynamoDBRepo stores all entities dynamo db
func NewDynamoDBRepo ¶
func NewDynamoDBRepo(config *aws.Config, tableName string, toStruct func(jsonString string) (interface{}, error)) *DynamoDBRepo
NewDynamoDBRepo creates a DynamoDBRepo and checks if the table exists. If not it will be created. the toStruct function allowed the internal unmarshalling
Example: For the struct
type Person struct { Name string }
The ToStruct function looks like:
func (person *Person) ToStruct(jsonString string) (interface{}, error) { err := json.Unmarshal([]byte(jsonString), &person) return person, err }
func NewStoreItemDynamoDBRepo ¶
func NewStoreItemDynamoDBRepo(config *aws.Config, tableName string, itemTemplate serialization.Serializable) *DynamoDBRepo
NewStoreItemDynamoDBRepo creates a DynamoDBRepo and checks if the table exists. If not it will be created.
func (*DynamoDBRepo) Delete ¶
func (repo *DynamoDBRepo) Delete(key string) error
Delete an item from the repository
func (*DynamoDBRepo) Find ¶
func (repo *DynamoDBRepo) Find(key string) (repository.KeyValuePair, error)
Find retrieves and item from the repository
func (*DynamoDBRepo) FindAll ¶
func (repo *DynamoDBRepo) FindAll() ([]repository.KeyValuePair, error)
FindAll items
func (*DynamoDBRepo) Overwrite ¶
func (repo *DynamoDBRepo) Overwrite(key string, in interface{}) (repository.KeyValuePair, error)
Save one item
func (*DynamoDBRepo) Save ¶
func (repo *DynamoDBRepo) Save(key string, in interface{}) (repository.KeyValuePair, error)
Save one item
type SSMParameterStoreRepo ¶
type SSMParameterStoreRepo struct {
// contains filtered or unexported fields
}
SSMParameterStoreRepo stores entries in AWS Parameter Store. Values will always be stored encrypted
func NewSSMParameterStoreRepo ¶
func NewSSMParameterStoreRepo(path string, ssmClient ssmiface.SSMAPI, itemTemplate serialization.Serializable) *SSMParameterStoreRepo
NewSSMParameterStoreRepo creates a new instance of the repository The repo can take structs and store them in serialized form.
func NewStringSSMParameterStoreRepo ¶
func NewStringSSMParameterStoreRepo(path string, ssmClient ssmiface.SSMAPI) *SSMParameterStoreRepo
NewStringSSMParameterStoreRepo creates a new instance of the repository The repo stores the string without conversion.
func (*SSMParameterStoreRepo) Delete ¶
func (repo *SSMParameterStoreRepo) Delete(key string) error
Only put a variable with the same name >=30 sec after deletion Not sure why, but this hint is documented in the AWS docu see https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DeleteParameters.html
func (*SSMParameterStoreRepo) Find ¶
func (repo *SSMParameterStoreRepo) Find(key string) (repository.KeyValuePair, error)
func (*SSMParameterStoreRepo) FindAll ¶
func (repo *SSMParameterStoreRepo) FindAll() ([]repository.KeyValuePair, error)
func (*SSMParameterStoreRepo) Overwrite ¶
func (repo *SSMParameterStoreRepo) Overwrite(key string, in interface{}) (repository.KeyValuePair, error)
func (*SSMParameterStoreRepo) Save ¶
func (repo *SSMParameterStoreRepo) Save(key string, in interface{}) (repository.KeyValuePair, error)