storage

package
v0.0.0-...-78bde51 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateKey = errors.New("duplicate key value violates unique constraint")
)

Functions

This section is empty.

Types

type Room

type Room struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	Name string `db:"name"`
}

type RoomsStorage

type RoomsStorage struct {
	// contains filtered or unexported fields
}

func NewRoomsStorage

func NewRoomsStorage(db *sqlx.DB) RoomsStorage

func (RoomsStorage) Create

func (s RoomsStorage) Create(room *Room) error

func (RoomsStorage) ReadAll

func (s RoomsStorage) ReadAll(rooms *[]Room) error

func (RoomsStorage) ReadByID

func (s RoomsStorage) ReadByID(room *Room) error

type User

type User struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	Email    string `db:"email"`
	Password []byte `db:"password"`
}

type UsersStorage

type UsersStorage struct {
	// contains filtered or unexported fields
}

func NewUsersStorage

func NewUsersStorage(db *sqlx.DB) UsersStorage

func (UsersStorage) Create

func (s UsersStorage) Create(user *User) error

func (UsersStorage) ReadByEmail

func (s UsersStorage) ReadByEmail(user *User) error

Jump to

Keyboard shortcuts

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