Documentation
¶
Index ¶
- type FirestoreStorage
- func (s *FirestoreStorage) Close(ctx context.Context) error
- func (s *FirestoreStorage) Delete(ctx context.Context, path string) error
- func (s *FirestoreStorage) Get(ctx context.Context, path string) (*RepoConfig, error)
- func (s *FirestoreStorage) ListAll(ctx context.Context) ([]string, error)
- func (s *FirestoreStorage) Set(ctx context.Context, path string, config *RepoConfig) error
- type InMemoryCache
- func (s *InMemoryCache) Clear(ctx context.Context)
- func (s *InMemoryCache) Close(ctx context.Context) error
- func (s *InMemoryCache) Delete(ctx context.Context, path string) error
- func (s *InMemoryCache) Get(ctx context.Context, path string) (*RepoConfig, error)
- func (s *InMemoryCache) ListAll(ctx context.Context) ([]string, error)
- func (s *InMemoryCache) Set(ctx context.Context, path string, config *RepoConfig) error
- type RepoConfig
- type Storage
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) 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) 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.
Click to show internal directories.
Click to hide internal directories.