secretmanager

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

README

AWS Secret Manager storage

Usage

package mypkg

import (
	"context"
	"fmt"
	"github.com/viant/afs"
	"github.com/viant/afs/file"
	_ "github.com/viant/afsc/aws"
	"log"
	"strings"
)

func Example_DownloadWithURL() {
	fs := afs.New()
	URL := "aws://secretmanager/us-west-1/secret/prod/my/test2"
	err := fs.Upload(context.TODO(), URL, file.DefaultFileOsMode, strings.NewReader("test is super secret"))
	if err != nil {
		log.Fatalf("err: %v\n", err)
	}
	data, err := fs.DownloadWithURL(context.TODO(), URL)
	if err != nil {
		log.Fatalf("err: %v\n", err)
	}
	fmt.Printf("%s %v\n", data, err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorager

func NewStorager(ctx context.Context, baseURL string, options ...storage.Option) (*storager, error)

NewStorager create a new secreate manager storager

Types

type Resource

type Resource struct {
	Region string
	Secret string
}

Resource represent secret resource

Jump to

Keyboard shortcuts

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