secrets

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Provides helpers for fetching the latest version of app secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, options ...Opt) (map[string]string, error)

Get fetches the secrets from the Fly.io secrets API. If no options are specified, all secrets are retrieved using a token that is automatically fetched from the machines API.

func Token

func Token(ctx context.Context) (string, error)

Token fetches a token authorized to read secrets for the app.

Types

type Opt

type Opt func(*opts)

func Labels

func Labels(labels ...string) Opt

Labels specifies the secrets to request. If not specified, all secrets are requested.

func Types

func Types(types ...int32) Opt

Types specifies the secret types to request. If not specified, only app secrets are requested.

func WithAppID

func WithAppID(appID int64) Opt

WithAppID sets the app ID to use for requests. If not specified, the app ID is derived from the token.

func WithClient

func WithClient(client *http.Client) Opt

WithClient sets the http.Client to use for requests. If not specified, a default is used.

func WithToken

func WithToken(token string) Opt

WithToken sets the token to use for requests. If not specified, a new token is fetched.

func WithVersions

func WithVersions(versions map[string]uint64) Opt

WithVersions sets the secret versions to request.

Jump to

Keyboard shortcuts

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