In Development Package, API may change between versions.

import "github.com/egdaemon/eg/runtime/x/wasi/egsecrets"

func CopyInto

func CopyInto(ctx context.Context, w io.Writer, uris ...string) error

CopyInto copies the secret content from the given URIs into the provided writer.

func CopyIntoFile

func CopyIntoFile(ctx context.Context, path string, uris ...string) (err error)

CopyIntoFile copies the secret content from the given URIs into a file at the provided path.

func CopyIntoFileOp

func CopyIntoFileOp(path string, uris ...string) eg.OpFn

CopyIntoFileOp returns an OpFn that copies the secret content from the given URIs into a file at the provided path.

func Env

func Env(ctx context.Context, uris ...string) []string

Env reads secrets from the given URIs and parses them as .env formatted data (one KEY=VALUE per line), returning the resulting environment variables.

func NewReader

func NewReader(ctx context.Context, uris ...string) io.Reader

NewReader returns an io.Reader that streams the secrets for each URI, separated by newlines. Each secret is read lazily on demand.

func Read

func Read(ctx context.Context, uri string) io.Reader

Read a secret from the given URI. Supported schemes: gcpsm://, awssm://, chachasm://, file://

func Update

func Update(ctx context.Context, uri string, r io.Reader) error

Update a secret at the given URI. Supported schemes: gcpsm://, awssm://, chachasm://, file://