Documentation
¶
Overview ¶
Package store provides MySQL-backed metadata storage for the Epoch control plane.
MySQL serves as an index/cache over the object-store-backed registry. Object storage remains the source of truth for blobs; MySQL provides queryable metadata.
Index ¶
- type Blob
- type DashboardStats
- type Repository
- type Store
- func (s *Store) Close() error
- func (s *Store) CreateToken(ctx context.Context, name, createdBy string) (string, error)
- func (s *Store) DeleteTag(ctx context.Context, repoName, tagName string) error
- func (s *Store) DeleteToken(ctx context.Context, id int64) error
- func (s *Store) GetRepository(ctx context.Context, name string) (*Repository, error)
- func (s *Store) GetStats(ctx context.Context) (*DashboardStats, error)
- func (s *Store) GetTag(ctx context.Context, repoName, tagName string) (*Tag, error)
- func (s *Store) ListRepositories(ctx context.Context) ([]Repository, error)
- func (s *Store) ListTags(ctx context.Context, repoName string) ([]Tag, error)
- func (s *Store) ListTokens(ctx context.Context) ([]Token, error)
- func (s *Store) SyncFromCatalog(ctx context.Context, reg *registry.Registry) error
- func (s *Store) ValidateToken(ctx context.Context, plaintext string) bool
- type Tag
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct {
Digest string `json:"digest"`
Size int64 `json:"size"`
MediaType string `json:"mediaType"`
RefCount int `json:"refCount"`
}
Blob is a DB blob record.
type DashboardStats ¶
type DashboardStats struct {
RepositoryCount int `json:"repositoryCount"`
TagCount int `json:"tagCount"`
BlobCount int `json:"blobCount"`
TotalSize int64 `json:"totalSize"`
}
DashboardStats holds aggregate stats for the UI dashboard.
type Repository ¶
type Repository struct {
ID int64 `json:"id"`
Name string `json:"name"`
TagCount int `json:"tagCount"`
TotalSize int64 `json:"totalSize"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Repository is a DB repository record.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps a MySQL connection for Epoch metadata.
func (*Store) CreateToken ¶
CreateToken generates and stores a new token. Returns the plaintext.
func (*Store) DeleteToken ¶
DeleteToken removes a token by ID.
func (*Store) GetRepository ¶
func (*Store) ListRepositories ¶
func (s *Store) ListRepositories(ctx context.Context) ([]Repository, error)
func (*Store) ListTokens ¶
ListTokens returns all tokens with plaintext visible.
func (*Store) SyncFromCatalog ¶
SyncFromCatalog reads the remote catalog and syncs all metadata into MySQL.
type Tag ¶
type Tag struct {
ID int64 `json:"id"`
RepositoryID int64 `json:"-"`
RepoName string `json:"repoName,omitempty"`
Name string `json:"name"`
Digest string `json:"digest"`
ManifestJSON string `json:"-"`
TotalSize int64 `json:"totalSize"`
LayerCount int `json:"layerCount"`
PushedAt time.Time `json:"pushedAt"`
SyncedAt time.Time `json:"syncedAt"`
}
Tag is a DB tag record.