Documentation
¶
Index ¶
- Variables
- type SQLiteStorage
- func (s *SQLiteStorage) Close() error
- func (s *SQLiteStorage) CreateUser(user *core.User) error
- func (s *SQLiteStorage) DeleteUser(id string) error
- func (s *SQLiteStorage) GetUserByEmail(email string) (*core.User, error)
- func (s *SQLiteStorage) GetUserById(id string) (*core.User, error)
- func (s *SQLiteStorage) UpdateUser(user *core.User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New("user not found") ErrUserAlreadyExists = errors.New("user already exists") )
Functions ¶
This section is empty.
Types ¶
type SQLiteStorage ¶
type SQLiteStorage struct {
// contains filtered or unexported fields
}
SQLiteStorage is a SQLite implementation of the Storage interface using pure Go (no CGO).
func New ¶
func New(dbPath string) (*SQLiteStorage, error)
New creates a new SQLite storage instance by opening or creating a database at dbPath.
func NewFromDB ¶
func NewFromDB(db *sql.DB) *SQLiteStorage
NewFromDB creates a SQLiteStorage from an existing *sql.DB connection.
func (*SQLiteStorage) Close ¶
func (s *SQLiteStorage) Close() error
Close closes the database connection.
func (*SQLiteStorage) CreateUser ¶
func (s *SQLiteStorage) CreateUser(user *core.User) error
CreateUser creates a new user in SQLite.
func (*SQLiteStorage) DeleteUser ¶
func (s *SQLiteStorage) DeleteUser(id string) error
DeleteUser removes a user from SQLite.
func (*SQLiteStorage) GetUserByEmail ¶
func (s *SQLiteStorage) GetUserByEmail(email string) (*core.User, error)
GetUserByEmail retrieves a user by email address.
func (*SQLiteStorage) GetUserById ¶
func (s *SQLiteStorage) GetUserById(id string) (*core.User, error)
GetUserById retrieves a user by ID.
func (*SQLiteStorage) UpdateUser ¶
func (s *SQLiteStorage) UpdateUser(user *core.User) error
UpdateUser updates an existing user in SQLite.
Click to show internal directories.
Click to hide internal directories.