Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDatabaseIfNotExists(path string) error
- type DatabaseSchemaVersion
- type KeyValueConfig
- type Store
- func (s *Store) Close() error
- func (s *Store) DeleteBlobById(id int64) error
- func (s *Store) EstimateSizeOfManagedContent() (int64, error)
- func (s *Store) FinalizeBlobRecord(blob *models.Blob) (*models.Blob, error)
- func (s *Store) GetAllBuckets() ([]string, error)
- func (s *Store) GetBlobIdsMatchingBucket(bucket string) ([]int64, error)
- func (s *Store) GetBlobIdsMatchingChecksum(checksum string) ([]int64, error)
- func (s *Store) GetBlobIdsMatchingName(name string) ([]int64, error)
- func (s *Store) RetrieveBlobById(id int64) (*models.Blob, error)
- func (s *Store) StoreBlobRecord(blob *models.Blob) (*models.Blob, error)
Constants ¶
const V1Schema = `` /* 464-byte string literal not displayed */
Variables ¶
var SchemaUnknownVersionError = errors.New("unable to find the version key")
var SchemaUnsupportedVersionError = errors.New("database version is unsupported")
Functions ¶
func CreateDatabaseIfNotExists ¶
CreateDatabaseIfNotExists creates an Repositron database at a given path if it is not configured.
Types ¶
type DatabaseSchemaVersion ¶
type DatabaseSchemaVersion int
DatabaseSchemaVersion describes which version of the database format is in use.
const ( DbSchemaInvalid DatabaseSchemaVersion = 0 DbSchemaV1 DatabaseSchemaVersion = 1 )
func GetDatabaseSchemaVersion ¶
func GetDatabaseSchemaVersion(path string) (DatabaseSchemaVersion, error)
GetDatabaseSchemaVersion checks that the Repositron database being used is the right version.
type KeyValueConfig ¶
func GetConfigurationValue ¶
func GetConfigurationValue(key string, db *sqlx.DB) (*KeyValueConfig, error)
func GetConfigurationValues ¶
func GetConfigurationValues(db *sqlx.DB) ([]KeyValueConfig, error)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func CreateStore ¶
CreateStore generates or opens a blob store.
func (*Store) DeleteBlobById ¶
DeleteBlobById deletes a record.
func (*Store) EstimateSizeOfManagedContent ¶
EstimateSizeOfManagedContent returns a summary of the size of all blobs store din the database.
func (*Store) FinalizeBlobRecord ¶
FinalizeBlobRecord completes a blob and records all fields.
func (*Store) GetAllBuckets ¶
GetAllBuckets retrieves a list of all the available buckets
func (*Store) GetBlobIdsMatchingBucket ¶
GetBlobIdsMatchingBucket retrieves a list of blobs which match a bucket.
func (*Store) GetBlobIdsMatchingChecksum ¶
GetBlobIdsMatchingChecksum retrieves a list of blobs which match a given SHA1.
func (*Store) GetBlobIdsMatchingName ¶
GetBlobIdsMatchingName retrieves a list of blobs which match a name.
func (*Store) RetrieveBlobById ¶
RetrieveBlobById returns a blob record from the database with a given ID.