file

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStorage

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

FileStorage implements filesystem-based storage for DEP services.

func New

func New(path string) (*FileStorage, error)

New creates a new FileStorage backend.

func (*FileStorage) RetrieveAssignerProfile

func (s *FileStorage) RetrieveAssignerProfile(_ context.Context, name string) (string, time.Time, error)

RetrieveAssignerProfile reads the assigner profile UUID and its configured timestamp from disk for name DEP name.

Returns an empty profile if it does not exist.

func (*FileStorage) RetrieveAuthTokens

func (s *FileStorage) RetrieveAuthTokens(_ context.Context, name string) (*client.OAuth1Tokens, error)

RetrieveAuthTokens reads the JSON DEP OAuth tokens from disk for name DEP name.

func (*FileStorage) RetrieveConfig

func (s *FileStorage) RetrieveConfig(_ context.Context, name string) (*client.Config, error)

RetrieveConfig reads the JSON DEP config of a DEP name.

Returns (nil, nil) if the DEP name does not exist, or if the config for the DEP name does not exist.

func (*FileStorage) RetrieveCursor

func (s *FileStorage) RetrieveCursor(_ context.Context, name string) (string, error)

RetrieveCursor reads the reads the DEP fetch and sync cursor from disk for name DEP name. We return an empty cursor if the cursor does not exist on disk.

func (*FileStorage) RetrieveTokenPKI

func (s *FileStorage) RetrieveTokenPKI(_ context.Context, name string) ([]byte, []byte, error)

RetrieveTokenPKI reads and returns the PEM bytes for the DEP token exchange certificate and private key from disk using name DEP name.

func (*FileStorage) StoreAssignerProfile

func (s *FileStorage) StoreAssignerProfile(_ context.Context, name string, profileUUID string) error

StoreAssignerProfile saves the assigner profile UUID to disk for name DEP name.

func (*FileStorage) StoreAuthTokens

func (s *FileStorage) StoreAuthTokens(_ context.Context, name string, tokens *client.OAuth1Tokens) error

StoreAuthTokens saves the DEP OAuth tokens to disk as JSON for name DEP name.

func (*FileStorage) StoreConfig

func (s *FileStorage) StoreConfig(_ context.Context, name string, config *client.Config) error

StoreConfig saves the DEP config to disk as JSON for name DEP name.

func (*FileStorage) StoreCursor

func (s *FileStorage) StoreCursor(_ context.Context, name, cursor string) error

StoreCursor saves the DEP fetch and sync cursor to disk for name DEP name.

func (*FileStorage) StoreTokenPKI

func (s *FileStorage) StoreTokenPKI(_ context.Context, name string, pemCert []byte, pemKey []byte) error

StoreTokenPKI stores the PEM bytes in pemCert and pemKey to disk for name DEP name.

Jump to

Keyboard shortcuts

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