user

package
v0.0.0-...-984c388 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stream = "coinlog.users"
)

Variables

View Source
var ErrNotFound = exception.ResourceNotFound{Resource: "user"}

Functions

This section is empty.

Types

type CreateCommand

type CreateCommand struct {
	ID          string `json:"id" validate:"required"`
	DisplayName string `json:"display_name" validate:"required,lte=96"`
}

type Event

type Event struct {
	UserID      string
	DisplayName string
	Action      string
	customtype.Auditable
}

func NewEvent

func NewEvent(v User, op domain.EventAction) Event

func (Event) GetKey

func (e Event) GetKey() string

type Repository

type Repository interface {
	storage.Repository[User]
}

type Service

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

func NewService

func NewService(r Repository, b *messaging.Bus) (Service, error)

func (Service) Create

func (s Service) Create(ctx context.Context, args any) error

func (Service) Delete

func (s Service) Delete(ctx context.Context, id string) error

func (Service) GetByID

func (s Service) GetByID(ctx context.Context, id string) (View, error)

func (Service) List

func (Service) Update

func (s Service) Update(ctx context.Context, args any) error

type UpdateCommand

type UpdateCommand struct {
	ID          string `json:"id" validate:"required"`
	DisplayName string `json:"display_name" validate:"required,lte=96"`
}

type User

type User struct {
	ID          string
	DisplayName string // req
	customtype.Auditable
	*domain.Aggregate
}

User individual interacting the system.

type View

type View struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name"`
	customtype.Auditable
}

func NewView

func NewView(usr User) View

Jump to

Keyboard shortcuts

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