storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirestoreStorage

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

func NewFirestoreStorage

func NewFirestoreStorage(client *firestore.Client, collection string) *FirestoreStorage

func (*FirestoreStorage) Close

func (s *FirestoreStorage) Close(ctx context.Context) error

func (*FirestoreStorage) Delete

func (s *FirestoreStorage) Delete(ctx context.Context, path string) error

func (*FirestoreStorage) Get

func (s *FirestoreStorage) Get(ctx context.Context, path string) (*RepoConfig, error)

func (*FirestoreStorage) ListAll

func (s *FirestoreStorage) ListAll(ctx context.Context) ([]string, error)

func (*FirestoreStorage) Set

func (s *FirestoreStorage) Set(ctx context.Context, path string, config *RepoConfig) error

type InMemoryCache

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

func NewInMemoryCache

func NewInMemoryCache(size int, ttl time.Duration, next Storage) *InMemoryCache

func (*InMemoryCache) Clear

func (s *InMemoryCache) Clear(ctx context.Context)

func (*InMemoryCache) Close

func (s *InMemoryCache) Close(ctx context.Context) error

func (*InMemoryCache) Delete

func (s *InMemoryCache) Delete(ctx context.Context, path string) error

func (*InMemoryCache) Get

func (s *InMemoryCache) Get(ctx context.Context, path string) (*RepoConfig, error)

func (*InMemoryCache) ListAll

func (s *InMemoryCache) ListAll(ctx context.Context) ([]string, error)

func (*InMemoryCache) Set

func (s *InMemoryCache) Set(ctx context.Context, path string, config *RepoConfig) error

type RepoConfig

type RepoConfig struct {
	Repo    string `firestore:"repo" yaml:"repo" json:"repo"`
	Display string `firestore:"display" yaml:"display" json:"display"`
	VCS     string `firestore:"vcs" yaml:"vcs" json:"vcs"`
	Subdir  string `firestore:"subdir" yaml:"subdir" json:"subdir"`
}

RepoConfig holds the configuration for a single repository.

type Storage

type Storage interface {
	// Get retrieves the configuration for the given path.
	// It returns nil, nil if the path is not found.
	Get(ctx context.Context, path string) (*RepoConfig, error)

	// ListAll lists all the Go modules. return with path
	ListAll(ctx context.Context) ([]string, error)

	// Set stores the configuration for the given path.
	Set(ctx context.Context, path string, config *RepoConfig) error

	// Delete deletes the Go module.
	Delete(ctx context.Context, path string) error

	// Close cleans up any resources used by the storage.
	// the passing context is used for tracing.
	Close(ctx context.Context) error
}

Storage defines the interface for retrieving and storing repository configurations.

Jump to

Keyboard shortcuts

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