ssmkv

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 9 Imported by: 0

README

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter struct {
	// contains filtered or unexported fields
}

func New

func New(client SSM, prefix string) *Getter
Example
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/ssm"
	"gitlab.com/rarifytech/ssmkv"
)

func main() {
	cfg, err := config.LoadDefaultConfig(context.TODO())
	if err != nil {
		log.Fatalf("failed to init aws config:%v", err)
	}

	client := ssm.NewFromConfig(cfg)
	getter := ssmkv.New(client, "stage-prefix/maybe-service")

	m, err := getter.GetStringMap("some-key")

	fmt.Println(m, err)
}
Output:

map[] <nil>

func (*Getter) GetStringMap

func (g *Getter) GetStringMap(key string) (map[string]interface{}, error)

type SSM

type SSM interface {
	GetParameter(
		context.Context, *ssm.GetParameterInput, ...func(*ssm.Options),
	) (*ssm.GetParameterOutput, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL