Documentation ¶
Index ¶
- type Config
- type DB
- func (db *DB) Close() error
- func (db *DB) CreateService(service *models.ServiceConfiguration) error
- func (db *DB) CreateUser(user *types.User) error
- func (db *DB) DeleteService(instanceID string) error
- func (db *DB) GetAllServices() ([]models.ServiceConfiguration, error)
- func (db *DB) GetServiceByInstanceID(instanceID string) (*models.ServiceConfiguration, error)
- func (db *DB) GetServiceByInstancePrefix(prefix string) (*models.ServiceConfiguration, error)
- func (db *DB) GetServiceByURL(url string) (*models.ServiceConfiguration, error)
- func (db *DB) GetUserByEmail(email string) (*types.User, error)
- func (db *DB) GetUserByID(id int64) (*types.User, error)
- func (db *DB) GetUserByUsername(username string) (*types.User, error)
- func (db *DB) HasUsers() (bool, error)
- func (db *DB) Path() string
- func (db *DB) UpdateService(service *models.ServiceConfiguration) error
- func (db *DB) UpdateUserPassword(userID int64, newPasswordHash string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Driver string Host string Port string User string Password string DBName string Path string // For SQLite }
Config holds database configuration
type DB ¶
DB represents the database connection
func InitDBWithConfig ¶
InitDBWithConfig initializes the database with the provided configuration
func (*DB) CreateService ¶
func (db *DB) CreateService(service *models.ServiceConfiguration) error
CreateService creates a new service configuration
func (*DB) CreateUser ¶
CreateUser creates a new user in the database
func (*DB) DeleteService ¶
DeleteService deletes a service configuration by its instance ID
func (*DB) GetAllServices ¶
func (db *DB) GetAllServices() ([]models.ServiceConfiguration, error)
GetAllServices retrieves all service configurations
func (*DB) GetServiceByInstanceID ¶
func (db *DB) GetServiceByInstanceID(instanceID string) (*models.ServiceConfiguration, error)
GetServiceByInstanceID retrieves a service configuration by its instance ID
func (*DB) GetServiceByInstancePrefix ¶
func (db *DB) GetServiceByInstancePrefix(prefix string) (*models.ServiceConfiguration, error)
GetServiceByInstancePrefix retrieves a service configuration by its instance ID prefix
func (*DB) GetServiceByURL ¶
func (db *DB) GetServiceByURL(url string) (*models.ServiceConfiguration, error)
GetServiceByURL retrieves a service configuration by its URL
func (*DB) GetUserByEmail ¶
GetUserByEmail retrieves a user by their email
func (*DB) GetUserByID ¶
GetUserByID retrieves a user by their ID
func (*DB) GetUserByUsername ¶
GetUserByUsername retrieves a user by their username
func (*DB) UpdateService ¶
func (db *DB) UpdateService(service *models.ServiceConfiguration) error
UpdateService updates an existing service configuration