storage

package
v0.0.0-...-a1fa394 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStore

type PostgresStore struct {
	DB *sql.DB
}

func NewPostgresStore

func NewPostgresStore(cfg *config.DBConfig) (*PostgresStore, error)

func (*PostgresStore) CreateUser

func (s *PostgresStore) CreateUser(user *models.User) error

func (*PostgresStore) DeleteUser

func (s *PostgresStore) DeleteUser(uuid uuid.UUID) error

func (*PostgresStore) GetUserById

func (s *PostgresStore) GetUserById(uuid uuid.UUID) (*models.User, error)

func (*PostgresStore) GetUsers

func (s *PostgresStore) GetUsers() ([]*models.User, error)

func (*PostgresStore) UpdateUser

func (s *PostgresStore) UpdateUser(user *models.User) error

type Storage

type Storage interface {
	CreateUser(user *models.User) error
	DeleteUser(uuid uuid.UUID) error
	UpdateUser(user *models.User) error
	GetUsers() ([]*models.User, error)
	GetUserById(uuid uuid.UUID) (*models.User, error)
}

Jump to

Keyboard shortcuts

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