Documentation
¶
Overview ¶
Package sqlite implements a SQLite-backed datastore for govc. This provides persistent storage with good performance for small to medium deployments.
Index ¶
- func Migrate(db *sql.DB) error
- func Rollback(db *sql.DB, targetVersion int) error
- type Migration
- type SQLiteStore
- func (s *SQLiteStore) BeginTx(ctx context.Context, opts *datastore.TxOptions) (datastore.Transaction, error)
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) CountEvents(filter datastore.EventFilter) (int64, error)
- func (s *SQLiteStore) CountObjects() (int64, error)
- func (s *SQLiteStore) DeleteConfig(key string) error
- func (s *SQLiteStore) DeleteObject(hash string) error
- func (s *SQLiteStore) DeleteObjects(hashes []string) error
- func (s *SQLiteStore) DeleteRef(repoID string, name string) error
- func (s *SQLiteStore) DeleteRepository(id string) error
- func (s *SQLiteStore) DeleteUser(id string) error
- func (s *SQLiteStore) GetAllConfig() (map[string]string, error)
- func (s *SQLiteStore) GetConfig(key string) (string, error)
- func (s *SQLiteStore) GetMetrics() datastore.Metrics
- func (s *SQLiteStore) GetObject(hash string) ([]byte, error)
- func (s *SQLiteStore) GetObjectSize(hash string) (int64, error)
- func (s *SQLiteStore) GetObjects(hashes []string) (map[string][]byte, error)
- func (s *SQLiteStore) GetRef(repoID string, name string) (*datastore.Reference, error)
- func (s *SQLiteStore) GetRepository(id string) (*datastore.Repository, error)
- func (s *SQLiteStore) GetStorageSize() (int64, error)
- func (s *SQLiteStore) GetUser(id string) (*datastore.User, error)
- func (s *SQLiteStore) GetUserByUsername(username string) (*datastore.User, error)
- func (s *SQLiteStore) HasObject(hash string) (bool, error)
- func (s *SQLiteStore) HealthCheck(ctx context.Context) error
- func (s *SQLiteStore) Info() map[string]interface{}
- func (s *SQLiteStore) Initialize(config datastore.Config) error
- func (s *SQLiteStore) IterateObjects(prefix string, fn func(hash string, data []byte) error) error
- func (s *SQLiteStore) ListObjects(prefix string, limit int) ([]string, error)
- func (s *SQLiteStore) ListRefs(repoID string, refType datastore.RefType) ([]*datastore.Reference, error)
- func (s *SQLiteStore) ListRepositories(filter datastore.RepositoryFilter) ([]*datastore.Repository, error)
- func (s *SQLiteStore) ListUsers(filter datastore.UserFilter) ([]*datastore.User, error)
- func (s *SQLiteStore) LogEvent(event *datastore.AuditEvent) error
- func (s *SQLiteStore) MetadataStore() datastore.MetadataStore
- func (s *SQLiteStore) ObjectStore() datastore.ObjectStore
- func (s *SQLiteStore) PutObject(hash string, data []byte) error
- func (s *SQLiteStore) PutObjects(objects map[string][]byte) error
- func (s *SQLiteStore) QueryEvents(filter datastore.EventFilter) ([]*datastore.AuditEvent, error)
- func (s *SQLiteStore) SaveRef(repoID string, ref *datastore.Reference) error
- func (s *SQLiteStore) SaveRepository(repo *datastore.Repository) error
- func (s *SQLiteStore) SaveUser(user *datastore.User) error
- func (s *SQLiteStore) SetConfig(key string, value string) error
- func (s *SQLiteStore) Type() string
- func (s *SQLiteStore) UpdateRef(repoID string, name string, newHash string) error
- func (s *SQLiteStore) UpdateRepository(id string, updates map[string]interface{}) error
- func (s *SQLiteStore) UpdateUser(id string, updates map[string]interface{}) error
- func (s *SQLiteStore) Vacuum() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore implements datastore.DataStore using SQLite
func (*SQLiteStore) BeginTx ¶
func (s *SQLiteStore) BeginTx(ctx context.Context, opts *datastore.TxOptions) (datastore.Transaction, error)
BeginTx begins a transaction
func (*SQLiteStore) CountEvents ¶
func (s *SQLiteStore) CountEvents(filter datastore.EventFilter) (int64, error)
CountEvents counts audit events
func (*SQLiteStore) CountObjects ¶
func (s *SQLiteStore) CountObjects() (int64, error)
CountObjects returns the total number of objects
func (*SQLiteStore) DeleteConfig ¶
func (s *SQLiteStore) DeleteConfig(key string) error
DeleteConfig deletes a configuration key
func (*SQLiteStore) DeleteObject ¶
func (s *SQLiteStore) DeleteObject(hash string) error
DeleteObject deletes an object
func (*SQLiteStore) DeleteObjects ¶
func (s *SQLiteStore) DeleteObjects(hashes []string) error
DeleteObjects deletes multiple objects at once
func (*SQLiteStore) DeleteRef ¶
func (s *SQLiteStore) DeleteRef(repoID string, name string) error
DeleteRef deletes a reference
func (*SQLiteStore) DeleteRepository ¶
func (s *SQLiteStore) DeleteRepository(id string) error
DeleteRepository deletes a repository
func (*SQLiteStore) DeleteUser ¶
func (s *SQLiteStore) DeleteUser(id string) error
DeleteUser deletes a user
func (*SQLiteStore) GetAllConfig ¶
func (s *SQLiteStore) GetAllConfig() (map[string]string, error)
GetAllConfig retrieves all configuration
func (*SQLiteStore) GetConfig ¶
func (s *SQLiteStore) GetConfig(key string) (string, error)
GetConfig retrieves a configuration value
func (*SQLiteStore) GetMetrics ¶
func (s *SQLiteStore) GetMetrics() datastore.Metrics
GetMetrics returns store metrics
func (*SQLiteStore) GetObject ¶
func (s *SQLiteStore) GetObject(hash string) ([]byte, error)
GetObject retrieves an object by hash
func (*SQLiteStore) GetObjectSize ¶
func (s *SQLiteStore) GetObjectSize(hash string) (int64, error)
GetObjectSize returns the size of an object
func (*SQLiteStore) GetObjects ¶
func (s *SQLiteStore) GetObjects(hashes []string) (map[string][]byte, error)
GetObjects retrieves multiple objects at once
func (*SQLiteStore) GetRepository ¶
func (s *SQLiteStore) GetRepository(id string) (*datastore.Repository, error)
GetRepository retrieves a repository by ID
func (*SQLiteStore) GetStorageSize ¶
func (s *SQLiteStore) GetStorageSize() (int64, error)
GetStorageSize returns the total storage size used
func (*SQLiteStore) GetUser ¶
func (s *SQLiteStore) GetUser(id string) (*datastore.User, error)
GetUser retrieves a user by ID
func (*SQLiteStore) GetUserByUsername ¶
func (s *SQLiteStore) GetUserByUsername(username string) (*datastore.User, error)
GetUserByUsername retrieves a user by username
func (*SQLiteStore) HasObject ¶
func (s *SQLiteStore) HasObject(hash string) (bool, error)
HasObject checks if an object exists
func (*SQLiteStore) HealthCheck ¶
func (s *SQLiteStore) HealthCheck(ctx context.Context) error
HealthCheck checks if the store is healthy
func (*SQLiteStore) Info ¶
func (s *SQLiteStore) Info() map[string]interface{}
Info returns store information
func (*SQLiteStore) Initialize ¶
func (s *SQLiteStore) Initialize(config datastore.Config) error
Initialize initializes the SQLite store
func (*SQLiteStore) IterateObjects ¶
IterateObjects iterates over all objects
func (*SQLiteStore) ListObjects ¶
func (s *SQLiteStore) ListObjects(prefix string, limit int) ([]string, error)
ListObjects lists objects with optional prefix filtering
func (*SQLiteStore) ListRefs ¶
func (s *SQLiteStore) ListRefs(repoID string, refType datastore.RefType) ([]*datastore.Reference, error)
ListRefs lists references for a repository
func (*SQLiteStore) ListRepositories ¶
func (s *SQLiteStore) ListRepositories(filter datastore.RepositoryFilter) ([]*datastore.Repository, error)
ListRepositories lists repositories with filtering
func (*SQLiteStore) ListUsers ¶
func (s *SQLiteStore) ListUsers(filter datastore.UserFilter) ([]*datastore.User, error)
ListUsers lists users with filtering
func (*SQLiteStore) LogEvent ¶
func (s *SQLiteStore) LogEvent(event *datastore.AuditEvent) error
LogEvent logs an audit event
func (*SQLiteStore) MetadataStore ¶
func (s *SQLiteStore) MetadataStore() datastore.MetadataStore
MetadataStore returns the metadata store interface
func (*SQLiteStore) ObjectStore ¶
func (s *SQLiteStore) ObjectStore() datastore.ObjectStore
ObjectStore returns the object store interface
func (*SQLiteStore) PutObject ¶
func (s *SQLiteStore) PutObject(hash string, data []byte) error
PutObject stores an object
func (*SQLiteStore) PutObjects ¶
func (s *SQLiteStore) PutObjects(objects map[string][]byte) error
PutObjects stores multiple objects at once
func (*SQLiteStore) QueryEvents ¶
func (s *SQLiteStore) QueryEvents(filter datastore.EventFilter) ([]*datastore.AuditEvent, error)
QueryEvents queries audit events
func (*SQLiteStore) SaveRef ¶
func (s *SQLiteStore) SaveRef(repoID string, ref *datastore.Reference) error
SaveRef saves a reference
func (*SQLiteStore) SaveRepository ¶
func (s *SQLiteStore) SaveRepository(repo *datastore.Repository) error
SaveRepository saves a repository
func (*SQLiteStore) SaveUser ¶
func (s *SQLiteStore) SaveUser(user *datastore.User) error
SaveUser saves a user
func (*SQLiteStore) SetConfig ¶
func (s *SQLiteStore) SetConfig(key string, value string) error
SetConfig sets a configuration value
func (*SQLiteStore) UpdateRef ¶
func (s *SQLiteStore) UpdateRef(repoID string, name string, newHash string) error
UpdateRef updates a reference hash
func (*SQLiteStore) UpdateRepository ¶
func (s *SQLiteStore) UpdateRepository(id string, updates map[string]interface{}) error
UpdateRepository updates a repository
func (*SQLiteStore) UpdateUser ¶
func (s *SQLiteStore) UpdateUser(id string, updates map[string]interface{}) error
UpdateUser updates a user