users

package
v0.0.0-...-54f9ae5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 16 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               uuid.UUID
	Username         string
	Email            string
	Image            *string
	Password         string
	AccountAddresses []string
}

func (*User) CheckPassword

func (u *User) CheckPassword(plain string) bool

func (*User) DecodePassword

func (u *User) DecodePassword(password string) []byte

func (*User) EncodePassword

func (u *User) EncodePassword(password string) string

func (*User) HasAccount

func (u *User) HasAccount(address string) bool

func (*User) HashPassword

func (u *User) HashPassword(plain string) (string, error)

type UserRepository

type UserRepository interface {
	Save(context.Context, User) error
	Get(ctx context.Context, ID uuid.UUID) (User, error)
	GetAll(ctx context.Context) ([]User, error)
}

func NewUserRepository

func NewUserRepository(storagePath string) UserRepository

type UserService

type UserService interface {
	Register(ctx context.Context, userName string, email string, password string) error
	Login(ctx context.Context, userName string, password string) (*User, error)
	GetByID(ctx context.Context, userID uuid.UUID) (*User, error)
	GetByEmail(ctx context.Context, email string) (*User, error)
	AddAccount(ctx context.Context, userID uuid.UUID, password string) (string, error)
	GetBalance(ctx context.Context, userID uuid.UUID, address string) (balanceFiat string, balanceETH string, err error)
}

func NewUserService

func NewUserService(userRepository UserRepository, accountService accounts.AccountService, priceService price.PriceService) UserService

Jump to

Keyboard shortcuts

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