Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Driver string
Host string
Port int
Username string
Password string
Database string
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime int
DataSource string
}
Config holds database configuration
type Connection ¶
Connection represents a database connection
func NewConnection ¶
func NewConnection(config Config) (*Connection, error)
NewConnection creates a new database connection based on the driver
func (*Connection) Ping ¶
func (c *Connection) Ping() error
Ping checks if the database connection is alive
type OptionRepository ¶
type OptionRepository struct {
// contains filtered or unexported fields
}
OptionRepository handles database operations for options.
func NewOptionRepository ¶
func NewOptionRepository(db *sql.DB) *OptionRepository
NewOptionRepository creates a new option repository.
func (*OptionRepository) Create ¶
func (r *OptionRepository) Create(key, value string) error
Create inserts a new option into the database.
func (*OptionRepository) Delete ¶
func (r *OptionRepository) Delete(key string) error
Delete removes an option from the database.
func (*OptionRepository) Get ¶
func (r *OptionRepository) Get(key string) (*Option, error)
Get retrieves an option by key.
func (*OptionRepository) List ¶
func (r *OptionRepository) List() ([]*Option, error)
List retrieves all options from the database.
func (*OptionRepository) Update ¶
func (r *OptionRepository) Update(key, value string) error
Update updates an option value.
Click to show internal directories.
Click to hide internal directories.