models

package
v0.0.0-...-006e77a Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID        int64
	Username  string
	Password  string
	CreatedAt *time.Time
}

func (*User) ComparePassword

func (user *User) ComparePassword(password string) (bool, error)

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *sql.DB) *UserRepository

func (*UserRepository) Create

func (r *UserRepository) Create(user User) (*User, error)

func (*UserRepository) GetById

func (r *UserRepository) GetById(id string) *User

func (*UserRepository) GetByUsername

func (r *UserRepository) GetByUsername(username string) *User

func (*UserRepository) Migrate

func (r *UserRepository) Migrate() error

Jump to

Keyboard shortcuts

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