Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.18 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.18 KB

Narcissus

PkgGoDev

Narcissus updates a Golang struct with fields that have been tagged with ssm:"Parameter" according to the corresponding value in SSM Parameter Store using reflection.

Installation

go get github.com/yhakbar/narcissus

Example Usage

import "github.com/yhakbar/narcissus"
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}
_ = narcissus.UpdateBySSM(&person, &ssmPath)
// If you want to reuse an SSM client, do so like this:
// wrapper := narcissus.Wrapper{Client: client}
// wrapper.UpdateBySSM(&person, &ssmPath)