nixcache

package
v0.0.0-...-b4a2add Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachedReadCaches

func CachedReadCaches(ctx context.Context) ([]*nixv1alpha1.NixBinCache, error)

func Caches

func Caches(
	ctx context.Context,
) ([]*nixv1alpha1.NixBinCache, error)

Caches return the list of caches the user has access to. If user is not logged in, it returns nil, nil. (no error).

func Configure

func Configure(ctx context.Context) error

func ConfigureReprompt

func ConfigureReprompt(ctx context.Context, username string) error

func DisableReadCaches

func DisableReadCaches()

func IsConfigured

func IsConfigured(ctx context.Context) bool

func S3Client

func S3Client(
	ctx context.Context,
) (*s3.Client, error)

func WriteCaches

func WriteCaches(
	ctx context.Context,
) ([]*nixv1alpha1.NixBinCache, error)

Types

type AWSCredentials

type AWSCredentials struct {
	// Version must always be 1.
	Version         int       `json:"Version"`
	AccessKeyID     string    `json:"AccessKeyId"`
	SecretAccessKey string    `json:"SecretAccessKey"`
	SessionToken    string    `json:"SessionToken"`
	Expiration      time.Time `json:"Expiration"`
}

AWSCredentials are short-lived credentials that grant access to a private Nix cache in S3. It marshals to JSON per the schema described in `aws help config-vars` under "Sourcing Credentials From External Processes".

func CachedCredentials

func CachedCredentials(ctx context.Context) (AWSCredentials, error)

CachedCredentials fetches short-lived credentials that grant access to the user's private cache.

func (AWSCredentials) Env

func (a AWSCredentials) Env() []string

Env returns the credentials as a slice of environment variables.

Jump to

Keyboard shortcuts

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