command

package
v0.0.0-...-0de0edb Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const LoginUserKind = "LoginUser"
View Source
const LogoutUserKind = "LogoutUser"
View Source
const RefreshSessionKind = "RefreshSession"

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginUser

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

func NewLoginUser

func NewLoginUser(
	userView ports.UserPgStorage,
	sessionStorage ports.SessionRedisStorage,
	logger logger.Logger,
) LoginUser

func (LoginUser) Handle

func (l LoginUser) Handle(ctx context.Context, command core.Command) (any, error)

type LoginUserCommand

type LoginUserCommand struct {
	Email      string
	Password   string
	AccessTTL  time.Duration
	RefreshTTL time.Duration
}

func (LoginUserCommand) Type

type LoginUserResult

type LoginUserResult struct {
	UserID       common.UID
	AccessToken  entity.Token
	RefreshToken entity.Token
}

type LogoutUser

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

func NewLogoutUser

func NewLogoutUser(
	sessionStorage ports.SessionRedisStorage,
	logger logger.Logger,
) LogoutUser

func (LogoutUser) Handle

func (l LogoutUser) Handle(ctx context.Context, command core.Command) (any, error)

type LogoutUserCommand

type LogoutUserCommand struct {
	RefreshTokenID string
	AccessTokenID  string
}

func (LogoutUserCommand) Type

type RefreshSession

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

func NewRefreshSession

func NewRefreshSession(
	userView ports.UserPgStorage,
	sessionStorage ports.SessionRedisStorage,
	logger logger.Logger,
) RefreshSession

func (RefreshSession) Handle

func (l RefreshSession) Handle(ctx context.Context, command core.Command) (any, error)

type RefreshSessionCommand

type RefreshSessionCommand struct {
	ID         string
	UserID     string
	AccessTTL  time.Duration
	RefreshTTL time.Duration
}

func (RefreshSessionCommand) Type

type RefreshSessionResult

type RefreshSessionResult struct {
	UserID      common.UID
	AccessToken entity.Token
}

Jump to

Keyboard shortcuts

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