storage

package
v0.0.0-...-ec15c9c Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 6 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 Session

type Session struct {
	ID        int32     `db:"id"`
	UUID      uuid.UUID `db:"uuid"`
	CreatedAt time.Time `db:"created_at"`

	UserID int32 `db:"user_id"`
	User
}

type SessionStorage

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

func NewSessionStorage

func NewSessionStorage(db *sqlx.DB) SessionStorage

func (SessionStorage) Create

func (s SessionStorage) Create(ctx context.Context, session *Session) error

type User

type User struct {
	ID        int32     `db:"id"`
	CreatedAt time.Time `db:"created_at"`

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

type UserStorage

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

func NewUserStorage

func NewUserStorage(db *sqlx.DB) UserStorage

func (UserStorage) Create

func (s UserStorage) Create(ctx context.Context, user *User) error

func (UserStorage) ReadByEmail

func (s UserStorage) ReadByEmail(ctx context.Context, user *User) error

Jump to

Keyboard shortcuts

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