storage

package
v0.0.0-...-35bea94 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

func NewFile

func NewFile(dir string, clientID string, issuerURL string) *File

func (*File) Delete

func (f *File) Delete(ctx context.Context) error

func (*File) MarshalOpts

func (f *File) MarshalOpts() []client.MarshalOpts

Note: We disable the refresh flow because we are storing

      credentials in plaintext.
			 We therefore ensure that any plaintext credentials that hit disk
      have a well-defined ttl.

func (*File) Read

func (f *File) Read(ctx context.Context) (*string, error)

func (*File) Set

func (f *File) Set(ctx context.Context, value string) error

type Keyring

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

Keyring implements the storage interface for the cache Using zalango/go-keyring because it doesn't rely on CGO

at the cost of less flexibility.
We can re-evaluate as needed and update this struct

func NewKeyring

func NewKeyring(clientID string, issuerURL string) *Keyring

NewKeyring returns a new keyring

func (*Keyring) Delete

func (k *Keyring) Delete(ctx context.Context) error

Delete will delete a value from the keyring

func (*Keyring) MarshalOpts

func (k *Keyring) MarshalOpts() []client.MarshalOpts

func (*Keyring) Read

func (k *Keyring) Read(ctx context.Context) (*string, error)

Read will read from the keyring

func (*Keyring) Set

func (k *Keyring) Set(ctx context.Context, value string) error

Set sets a value to the keyring

type Storage

type Storage interface {
	Read(context.Context) (*string, error)
	Set(ctx context.Context, value string) error
	Delete(context.Context) error

	MarshalOpts() []client.MarshalOpts
}

Storage represents a storage backend for a cache

func GetOIDC

func GetOIDC(clientID string, issuerURL string) (Storage, error)

Jump to

Keyboard shortcuts

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