repository

package
v0.0.0-...-b2063a2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WireSet = wire.NewSet(NewRepository)
)

Functions

This section is empty.

Types

type AppUser

type AppUser struct {
	ID        string
	Username  string
	Password  string
	FirstName string
	LastName  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (AppUser) TableName

func (user AppUser) TableName() string

type PgUserRepository

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

func (*PgUserRepository) Authenticate

func (m *PgUserRepository) Authenticate(username string, password string) (bool, error)

func (*PgUserRepository) CreateAccount

func (m *PgUserRepository) CreateAccount(username string, password string, firstName string, lastName string) (bool, error)

func (*PgUserRepository) GetAccount

func (m *PgUserRepository) GetAccount(username string) (*AppUser, error)

type UserRepository

type UserRepository interface {
	Authenticate(username string, password string) (bool, error)
	CreateAccount(username string, password string, firstName string, lastName string) (bool, error)
	GetAccount(username string) (*AppUser, error)
}

func NewRepository

func NewRepository(db gorm.DB) UserRepository

Jump to

Keyboard shortcuts

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