domain

package
v0.0.0-...-afd9d8a Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 6 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
}

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