Documentation
¶
Index ¶
- Constants
- func GlobMatch(patterns []string, fileName string) (bool, error)
- type DbFile
- type DbFileInfo
- type DbFileReader
- type DbFs
- func (d *DbFs) CreateTempSourceDir() (string, error)
- func (d *DbFs) FileHash(excludeGlob []string) (string, error)
- func (d *DbFs) Glob(pattern string) (matches []string, err error)
- func (d *DbFs) Open(name string) (fs.File, error)
- func (d *DbFs) ReadFile(name string) ([]byte, error)
- func (d *DbFs) Reset()
- func (d *DbFs) Stat(name string) (fs.FileInfo, error)
- func (d *DbFs) StaticFiles() []string
- type FileStore
- func (f *FileStore) AddAppVersionDisk(ctx context.Context, tx types.Transaction, metadata types.AppMetadata, ...) error
- func (f *FileStore) GetAppFiles(ctx context.Context, tx types.Transaction) ([]types.AppFile, error)
- func (f *FileStore) GetAppVersion(ctx context.Context, tx types.Transaction, version int) (*types.AppVersion, error)
- func (f *FileStore) GetAppVersions(ctx context.Context, tx types.Transaction) ([]types.AppVersion, error)
- func (f *FileStore) GetFileBySha(ctx context.Context, tx types.Transaction, sha string) ([]byte, string, error)
- func (f *FileStore) GetFileByShaTx(sha string) ([]byte, string, error)
- func (f *FileStore) GetHighestVersion(ctx context.Context, tx types.Transaction, appId types.AppId) (int, error)
- func (f *FileStore) IncrementAppVersion(ctx context.Context, tx types.Transaction, metadata *types.AppMetadata) error
- func (f *FileStore) PromoteApp(ctx context.Context, tx types.Transaction, prodAppId types.AppId, ...) error
- func (f *FileStore) Reset()
- type Metadata
- func (m *Metadata) BeginTransaction(ctx context.Context) (types.Transaction, error)
- func (m *Metadata) CommitTransaction(tx types.Transaction) error
- func (m *Metadata) CreateApp(ctx context.Context, tx types.Transaction, app *types.AppEntry) error
- func (m *Metadata) DeleteApp(ctx context.Context, tx types.Transaction, id types.AppId) error
- func (m *Metadata) GetAllApps(includeInternal bool) ([]types.AppInfo, error)
- func (m *Metadata) GetApp(pathDomain types.AppPathDomain) (*types.AppEntry, error)
- func (m *Metadata) GetAppTx(ctx context.Context, tx types.Transaction, pathDomain types.AppPathDomain) (*types.AppEntry, error)
- func (m *Metadata) GetAppsForDomain(domain string) ([]string, error)
- func (m *Metadata) GetLinkedApps(ctx context.Context, tx types.Transaction, mainAppId types.AppId) ([]*types.AppEntry, error)
- func (m *Metadata) RollbackTransaction(tx types.Transaction) error
- func (m *Metadata) UpdateAppMetadata(ctx context.Context, tx types.Transaction, app *types.AppEntry) error
- func (m *Metadata) UpdateAppSettings(ctx context.Context, tx types.Transaction, app *types.AppEntry) error
- func (m *Metadata) VersionUpgrade() error
Constants ¶
View Source
const ( COMPRESSION_THRESHOLD = 0 // files above this size are stored compressed. The chi Compress middleware does not have a threshold, // so the threshold is set to zero here BROTLI_COMPRESSION_LEVEL = 9 // https://paulcalvano.com/2018-07-25-brotli-compression-how-much-will-it-reduce-your-content/ seems )
View Source
const CURRENT_DB_VERSION = 3
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DbFile ¶ added in v0.2.0
type DbFile struct {
// contains filtered or unexported fields
}
func NewDBFile ¶ added in v0.2.0
func NewDBFile(name string, compressionType string, data []byte, fi DbFileInfo) *DbFile
func (*DbFile) ReadCompressed ¶ added in v0.3.0
type DbFileInfo ¶ added in v0.2.0
type DbFileInfo struct {
// contains filtered or unexported fields
}
func (*DbFileInfo) IsDir ¶ added in v0.2.0
func (fi *DbFileInfo) IsDir() bool
func (*DbFileInfo) ModTime ¶ added in v0.2.0
func (fi *DbFileInfo) ModTime() time.Time
func (*DbFileInfo) Mode ¶ added in v0.2.0
func (fi *DbFileInfo) Mode() fs.FileMode
func (*DbFileInfo) Name ¶ added in v0.2.0
func (fi *DbFileInfo) Name() string
func (*DbFileInfo) Size ¶ added in v0.2.0
func (fi *DbFileInfo) Size() int64
func (*DbFileInfo) Sys ¶ added in v0.2.0
func (fi *DbFileInfo) Sys() any
type DbFileReader ¶ added in v0.3.0
type DbFileReader struct {
// contains filtered or unexported fields
}
func NewDbFileReader ¶ added in v0.6.0
func NewDbFileReader(compressionType string, data []byte) *DbFileReader
func (*DbFileReader) ReadCompressed ¶ added in v0.3.0
func (f *DbFileReader) ReadCompressed() ([]byte, string, error)
type DbFs ¶ added in v0.2.0
func (*DbFs) CreateTempSourceDir ¶ added in v0.6.0
func (*DbFs) FileHash ¶ added in v0.6.0
FileHash returns a hash of the file names and their corresponding sha256 hashes
func (*DbFs) StaticFiles ¶ added in v0.3.0
type FileStore ¶ added in v0.2.0
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶ added in v0.2.0
func (*FileStore) AddAppVersionDisk ¶ added in v0.4.1
func (f *FileStore) AddAppVersionDisk(ctx context.Context, tx types.Transaction, metadata types.AppMetadata, checkoutDir string) error
func (*FileStore) GetAppFiles ¶ added in v0.4.1
func (*FileStore) GetAppVersion ¶ added in v0.4.1
func (f *FileStore) GetAppVersion(ctx context.Context, tx types.Transaction, version int) (*types.AppVersion, error)
func (*FileStore) GetAppVersions ¶ added in v0.4.1
func (f *FileStore) GetAppVersions(ctx context.Context, tx types.Transaction) ([]types.AppVersion, error)
func (*FileStore) GetFileBySha ¶ added in v0.2.0
func (*FileStore) GetFileByShaTx ¶ added in v0.3.0
func (*FileStore) GetHighestVersion ¶ added in v0.3.0
func (*FileStore) IncrementAppVersion ¶ added in v0.4.1
func (f *FileStore) IncrementAppVersion(ctx context.Context, tx types.Transaction, metadata *types.AppMetadata) error
func (*FileStore) PromoteApp ¶ added in v0.3.0
func (f *FileStore) PromoteApp(ctx context.Context, tx types.Transaction, prodAppId types.AppId, metadata *types.AppMetadata) error
type Metadata ¶
Metadata is the metadata persistence layer
func NewMetadata ¶
NewMetadata creates a new metadata persistence layer
func (*Metadata) BeginTransaction ¶ added in v0.3.0
BeginTransaction starts a new Transaction
func (*Metadata) CommitTransaction ¶ added in v0.3.0
func (m *Metadata) CommitTransaction(tx types.Transaction) error
CommitTransaction commits a transaction
func (*Metadata) GetAllApps ¶
func (*Metadata) GetAppTx ¶ added in v0.3.0
func (m *Metadata) GetAppTx(ctx context.Context, tx types.Transaction, pathDomain types.AppPathDomain) (*types.AppEntry, error)
func (*Metadata) GetAppsForDomain ¶
func (*Metadata) GetLinkedApps ¶ added in v0.3.0
func (m *Metadata) GetLinkedApps(ctx context.Context, tx types.Transaction, mainAppId types.AppId) ([]*types.AppEntry, error)
GetLinkedApps gets all the apps linked to the given main app (staging and preview apps)
func (*Metadata) RollbackTransaction ¶ added in v0.3.0
func (m *Metadata) RollbackTransaction(tx types.Transaction) error
Rollbacktypes.Transaction rolls back a transaction
func (*Metadata) UpdateAppMetadata ¶
func (*Metadata) UpdateAppSettings ¶ added in v0.3.0
func (*Metadata) VersionUpgrade ¶
Click to show internal directories.
Click to hide internal directories.