usermodel

package
v0.0.0-...-2e499f1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLogin    = errors.New("incorrect username or password")
	ErrRegister = errors.New("user with such name already exists")
)

Functions

This section is empty.

Types

type User

type User struct {
	Name string `json:"name"`
	Date string `json:"date"`
}

type UserStore

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

func NewUserStore

func NewUserStore(db *sql.DB) *UserStore

func (*UserStore) GetByName

func (us *UserStore) GetByName(ctx context.Context, username string) (*User, error)

func (*UserStore) GetByNameAndPassword

func (us *UserStore) GetByNameAndPassword(ctx context.Context, username, password string) (*User, error)

func (*UserStore) Insert

func (us *UserStore) Insert(ctx context.Context, username, password string) (*User, error)

Jump to

Keyboard shortcuts

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