Documentation ¶
Overview ¶
Package narcissus updates a struct with fields that have been tagged with `ssm:"Parameter"` according to the corresponding value in SSM Parameter Store using reflection.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateBySSM ¶
UpdateBySSM updates a struct by fields tagged `ssm`.
Example ¶
type Name struct { FirstName string `ssm:"Name/FirstName"` LastName string `ssm:"Name/LastName"` } type Contact struct { Email string `ssm:"Contact/Email"` Number string `ssm:"Contact/Number"` } type Person struct { Name Name Contact Contact FavoriteNumber int `ssm:"FavoriteNumber"` FavoriteInconvenientNumber float64 `ssm:"FavoriteInconvenientNumber"` } person := Person{} ssmPath := "/path/to/parameters/" // You can get this wrapper like so: wrapper := narcissus.Wrapper{Client: client} _ = wrapper.UpdateBySSM(&person, &ssmPath) // If you don't want to reuse a client, simply use narcissus.UpdateBySSM(&person, &ssmPath) fmt.Println(person)
Output: {{Jane Doe} {jane.doe@email.com (123)456-7890} 26 26.24}
Types ¶
type Wrapper ¶
Wrapper wraps the SSM Client so that it can be mocked. Also allows for client reuse.
func (*Wrapper) UpdateBySSM ¶
UpdateBySSM updates a struct by fields tagged `ssm` using a given wrapped SSM client.
Click to show internal directories.
Click to hide internal directories.