users

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserEmailNotFound      = errors.New("user with the email not found")
	ErrUserEmailAlreadyExists = errors.New("user with the email already exists")
)

Functions

func NewPostgresStore added in v1.8.2

func NewPostgresStore(pqdriver *pgxpool.Pool, tablename string) *pgstore

Types

type User

type User struct {
	ID             string
	FullName       string
	Email          string
	Phone          string
	ContactAddress string
}

func (*User) Sanitize

func (us *User) Sanitize()

func (*User) ValidateForCreate added in v1.8.2

func (us *User) ValidateForCreate() error

ValidateForCreate runs the validation required for when a user is being created. i.e. ID is not available

type Users

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

func NewService

func NewService(store store) *Users

func (*Users) AsyncCreateUsers added in v1.8.2

func (us *Users) AsyncCreateUsers(ctx context.Context, users []User) error

func (*Users) CreateUser

func (us *Users) CreateUser(ctx context.Context, user *User) (*User, error)

func (*Users) ReadByEmail

func (us *Users) ReadByEmail(ctx context.Context, email string) (*User, error)

Jump to

Keyboard shortcuts

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