Documentation ¶
Index ¶
- type DBConfigInterface
- type DBInitImpl
- type DBInitializer
- type DBInterface
- type InitDB
- func (i *InitDB) CheckEncrypted(dbDir string, dbName string) (bool, error)
- func (i *InitDB) CreateSaltTable(db *sql.DB) error
- func (i *InitDB) CreateTimestampIndex(db *sql.DB) error
- func (i *InitDB) InitializeDB(password string) (*sql.DB, error)
- func (i *InitDB) RetrieveSalt(db *sql.DB, id int64) ([]byte, error)
- func (i *InitDB) RetrieveSaltByTimestamp(db *sql.DB, timestamp int64) ([]byte, error)
- func (i *InitDB) StoreSalt(db SQLExecer, saltValue []byte, manisfestGenerationTimestamp int64) (int64, error)
- type RealDB
- func (db *RealDB) CheckEncrypted(dbDir, dbFilename string) (bool, error)
- func (db *RealDB) CreateSaltTable(database *sql.DB) error
- func (db *RealDB) CreateTimestampIndex(database *sql.DB) error
- func (db *RealDB) Initialize(password string) (*sql.DB, error)
- func (db *RealDB) RetrieveSaltByTimestamp(database *sql.DB, timestamp int64) ([]byte, error)
- func (db *RealDB) StoreSalt(database SQLExecer, salt []byte, timestamp int64) error
- type RealDBConfig
- func (db *RealDBConfig) GetConfigName() string
- func (db *RealDBConfig) GetConfigPath() string
- func (db *RealDBConfig) GetDB() *sql.DB
- func (db *RealDBConfig) GetDBDir() string
- func (db *RealDBConfig) GetDBFilename() string
- func (db *RealDBConfig) GetDBPassword() string
- func (db *RealDBConfig) GetLog() logger.LoggerInterface
- type SQLExecer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBConfigInterface ¶
type DBInitImpl ¶
type DBInitImpl struct { }
func (*DBInitImpl) NewInitDB ¶
func (db *DBInitImpl) NewInitDB(dbDir string, dbFilename string, log logger.LoggerInterface) DBInterface
NewInitDB creates a new DB instance based on the provided parameters
type DBInitializer ¶
type DBInitializer interface {
NewInitDB(dbDir string, dbFilename string, log logger.LoggerInterface) DBInterface
}
type DBInterface ¶
type DBInterface interface { Initialize(password string) (*sql.DB, error) CreateSaltTable(db *sql.DB) error StoreSalt(db SQLExecer, salt []byte, timestamp int64) error RetrieveSaltByTimestamp(db *sql.DB, timestamp int64) ([]byte, error) CreateTimestampIndex(db *sql.DB) error CheckEncrypted(dbDir string, dbFilename string) (bool, error) }
type InitDB ¶
type InitDB struct { DBDir string DBFilename string Log logger.LoggerInterface }
func NewInitDB ¶
func NewInitDB(DBDir string, DBFilename string, log logger.LoggerInterface) *InitDB
func (*InitDB) CheckEncrypted ¶
func (*InitDB) CreateSaltTable ¶
CreateSaltTable creates a table to store salts in the database.
func (*InitDB) CreateTimestampIndex ¶
CreateTimestampIndex creates an index on the timestamp column to speed up queries.
func (*InitDB) InitializeDB ¶
Initialize initializes the encrypted SQLite database.
func (*InitDB) RetrieveSalt ¶
RetrieveSalt fetches a salt by its ID.
func (*InitDB) RetrieveSaltByTimestamp ¶
RetrieveSaltByTimestamp fetches a salt by its associated timestamp.
type RealDB ¶
type RealDB struct {
Init *InitDB
}
func (*RealDB) CheckEncrypted ¶
func (*RealDB) CreateTimestampIndex ¶
func (*RealDB) Initialize ¶
Initialize maps to InitDB's Initialize
func (*RealDB) RetrieveSaltByTimestamp ¶
RetrieveSaltByTimestamp maps to InitDB's RetrieveSaltByTimestamp
type RealDBConfig ¶
func (*RealDBConfig) GetConfigName ¶
func (db *RealDBConfig) GetConfigName() string
func (*RealDBConfig) GetConfigPath ¶
func (db *RealDBConfig) GetConfigPath() string
func (*RealDBConfig) GetDB ¶
func (db *RealDBConfig) GetDB() *sql.DB
func (*RealDBConfig) GetDBDir ¶
func (db *RealDBConfig) GetDBDir() string
func (*RealDBConfig) GetDBFilename ¶
func (db *RealDBConfig) GetDBFilename() string
func (*RealDBConfig) GetDBPassword ¶
func (db *RealDBConfig) GetDBPassword() string
func (*RealDBConfig) GetLog ¶
func (db *RealDBConfig) GetLog() logger.LoggerInterface
Click to show internal directories.
Click to hide internal directories.