secret

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package secret fetches and caches development secrets for Encore apps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// Synced is when the values were last synced,
	// or the zero value if no sync has taken place.
	Synced time.Time
	// Values is a key-value map of defined secrets.
	Values map[string]string
}

Data is a snapshot of an Encore app's development secret values.

type LoadResult added in v1.13.2

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

func (*LoadResult) Get added in v1.13.2

func (lr *LoadResult) Get(ctx context.Context, expSet *experiments.Set) (data *Data, err error)

Get returns the result of the prefetch. It blocks until the initial fetch is ready or until ctx is cancelled. For subsequent calls to Get (such as during live reload), it returns any more recent data that has been subsequently cached.

type Manager

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

Manager manages the secrets cache for running Encore apps.

func New

func New() *Manager

New returns a new manager.

func (*Manager) Load added in v1.13.2

func (mgr *Manager) Load(app *apps.Instance) *LoadResult

Load loads the secrets for appSlug. If appSlug is empty, (*LoadResult).Get resolves to empty secret data.

func (*Manager) UpdateKey

func (mgr *Manager) UpdateKey(appSlug, key, value string)

UpdateKey updates the cached secret key to the given value.

Jump to

Keyboard shortcuts

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