awssecretsfs

package
v0.0.0-...-e2c53ed Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package awssecrets provides an implementation of fs.ReadFileFS that reads secrets from the AWS secretsmanager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg aws.Config, options ...Option) fs.ReadFileFS

New creates a new instance of fs.ReadFile backed by the secretsmanager.

Types

type Client

type Client interface {
	ListSecretVersionIds(ctx context.Context, params *secretsmanager.ListSecretVersionIdsInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.ListSecretVersionIdsOutput, error)
	GetSecretValue(ctx context.Context, params *secretsmanager.GetSecretValueInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.GetSecretValueOutput, error)
}

Client represents the set of AWS S3 client methods used by s3fs.

type Option

type Option func(o *options)

Option represents an option to New.

func WithSecretsClient

func WithSecretsClient(client Client) Option

WithSecretsClient specifies the secretsmanager.Client to use. If not specified, a new is created.

func WithSecretsOptions

func WithSecretsOptions(opts ...func(*secretsmanager.Options)) Option

WithSecretsOptions wraps secretsmanager.Options for use when creating an s3.Client.

type T

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

T implements fs.ReadFileFS for secretsmanager.

func NewSecretsFS

func NewSecretsFS(cfg aws.Config, options ...Option) *T

NewSecretsFS creates a new instance of T.

func (*T) Open

func (smfs *T) Open(name string) (fs.File, error)

Open implements fs.FS. Name can be the short name of the secret or the ARN.

func (*T) ReadFile

func (smfs *T) ReadFile(name string) ([]byte, error)

ReadFile implements fs.ReadFileFS. Name can be the short name of the secret or the ARN.

func (*T) ReadFileCtx

func (smfs *T) ReadFileCtx(ctx context.Context, name string) ([]byte, error)

ReadFileCtx is like ReadFile but with a context.

Jump to

Keyboard shortcuts

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