application

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Queries  *Queries
	Commands *Commands
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(ev mediator.Mediator, repo domain.Repository, read QueryRepository) *Application

func (*Application) Get

func (app *Application) Get(ctx context.Context, logger *slog.Logger, uid string) (*User, error)

type CommandChangePassword

type CommandChangePassword struct {
	ID          string `json:"_"`
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

type CommandChangePasswordHandler

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

func NewCommandChangePasswordHandler

func NewCommandChangePasswordHandler(repo domain.Repository) *CommandChangePasswordHandler

func (*CommandChangePasswordHandler) Handle

type Commands

type Commands struct {
	ChangePassword *CommandChangePasswordHandler
}

type FindUserListHandler

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

func NewFindUserListHandler

func NewFindUserListHandler(read QueryRepository) *FindUserListHandler

func (*FindUserListHandler) Handle

type Queries

type Queries struct {
	FindUserList *FindUserListHandler
}

type QueryFindUserListRequest

type QueryFindUserListRequest struct {
	Name     string `form:"name"`
	Page     int    `form:"page"`
	PageSize int    `form:"page_size"`
}

type QueryFindUserListResponse

type QueryFindUserListResponse struct {
	Total int     `json:"total"`
	Users []*User `json:"users"`
}

type QueryRepository

type QueryRepository interface {
	FindUserList(ctx context.Context, name string, limit, offset int) ([]*User, error)
	CountUserNumber(context.Context, string) (int, error)
}

type User

type User struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type UserCreatedHandler

type UserCreatedHandler struct {
}

func NewUserCreatedHandler

func NewUserCreatedHandler() *UserCreatedHandler

func (UserCreatedHandler) Handle

func (s UserCreatedHandler) Handle(ctx context.Context, ev mediator.Event)

func (UserCreatedHandler) Listening

func (s UserCreatedHandler) Listening() []mediator.EventKind

Jump to

Keyboard shortcuts

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