domain

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EKUserCreated = mediator.EventKind("user.created")

Variables

This section is empty.

Functions

This section is empty.

Types

type EventUserCreated

type EventUserCreated struct {
	ID    string
	Name  string
	Email string
}

func (EventUserCreated) Kind

type Repository

type Repository interface {
	Get(context.Context, string) (*User, error)
	Save(context.Context, *User) error
}

type User

type User struct {
	ID             string `validate:"required"`
	Name           string `validate:"required"`
	Email          string `validate:"required,email"`
	HashedPassword []byte `copier:"Password"`
	Events         mediator.EventCollection
	Version        int
	Dirty          int32
	Deleted        bool
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

func NewUser

func NewUser(name, password, email string) (*User, error)

func (*User) ChangePassword

func (u *User) ChangePassword(o, n string) error

func (*User) Validate

func (u *User) Validate() error

Jump to

Keyboard shortcuts

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