storage

package
v0.0.0-...-3915665 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMigrations

func ApplyMigrations(db *sql.DB, dbName string) error

Types

type Storage

type Storage struct {
	DB *bun.DB
}

func NewStorage

func NewStorage(cfg *config.Config) (*Storage, error)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) CreateUser

func (s *Storage) CreateUser(ctx context.Context, user *apimodels.User) error

func (*Storage) GetUserByUsername

func (s *Storage) GetUserByUsername(ctx context.Context, name string) (apimodels.User, error)

func (*Storage) GetUserIDByToken

func (s *Storage) GetUserIDByToken(ctx context.Context, token string) (int64, error)

func (*Storage) UserExists

func (s *Storage) UserExists(ctx context.Context, username, email string) (bool, error)

func (*Storage) UserExistsByID

func (s *Storage) UserExistsByID(ctx context.Context, userID int64) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址