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