sqlrepo

package
v0.0.0-...-5f01fc0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fromer

type Fromer interface {
	From(...any) *SelectDataset
}

type GramRepo

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

func NewGramRepo

func NewGramRepo(db *Database, now fnTime) GramRepo

func (GramRepo) Add

func (r GramRepo) Add(userID uint64, body string) (_ uint64, err error)

func (GramRepo) List

func (r GramRepo) List(userID uint64) (_ []model.Gram, err error)

func (GramRepo) Sparkle

func (r GramRepo) Sparkle(gramID, userID uint64) (_ uint64, err error)

func (GramRepo) WithTx

func (r GramRepo) WithTx(fn func(GramRepo) error) error

WithTx starts a new transaction and executes it in Wrap method

type Inserter

type Inserter interface {
	Insert(interface{}) *InsertDataset
}

type UserRepo

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

func NewUserRepo

func NewUserRepo(db *Database, now fnTime) UserRepo

func (UserRepo) Add

func (r UserRepo) Add(firstName, lastName, userName, avatar string) (_ uint64, err error)

func (UserRepo) Begin

func (r UserRepo) Begin() (_ UserRepo, err error)

func (UserRepo) CertificateAdd

func (r UserRepo) CertificateAdd(sha256 string, expireAt int64, userID uint64) error

func (UserRepo) CertificateListByUser

func (r UserRepo) CertificateListByUser(userID uint64) (_ []model.Certificate, err error)

func (UserRepo) CodeGet

func (r UserRepo) CodeGet(_ uint64) (_ string, found bool, err error)

func (UserRepo) Commit

func (r UserRepo) Commit() (_ error)

func (UserRepo) Get

func (r UserRepo) Get(id uint64) (_ model.User, found bool, err error)

func (UserRepo) GetByCertificate

func (r UserRepo) GetByCertificate(certSHA256 string) (_ model.User, found bool, err error)

func (UserRepo) GetByUserName

func (r UserRepo) GetByUserName(userName string) (_ model.User, found bool, err error)

func (UserRepo) PasswordGet

func (r UserRepo) PasswordGet(userID uint64) (_ model.Password, found bool, err error)

func (UserRepo) PasswordSet

func (r UserRepo) PasswordSet(userID uint64, password model.Password) error

func (UserRepo) ProfileGet

func (r UserRepo) ProfileGet(userID uint64) (_ model.Profile, _ []model.Certificate, found bool, err error)

func (UserRepo) Rollback

func (r UserRepo) Rollback() (_ error)

func (UserRepo) UpdateAvatar

func (r UserRepo) UpdateAvatar(userID uint64, avatar string) error

func (UserRepo) UpdateFirstName

func (r UserRepo) UpdateFirstName(userID uint64, firstName string) error

func (UserRepo) UpdateLastName

func (r UserRepo) UpdateLastName(userID uint64, lastName string) error

func (UserRepo) UpdateSeen

func (r UserRepo) UpdateSeen(userID uint64) error

func (UserRepo) UpdateUserName

func (r UserRepo) UpdateUserName(userID uint64, userName string) error

func (UserRepo) WithTx

func (r UserRepo) WithTx(fn func(UserRepo) error) error

WithTx starts a new transaction and executes it in Wrap method

Jump to

Keyboard shortcuts

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