query

package
v0.0.0-...-3ca17b7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUser

type GetUser struct {
	ID     uuid.UUID       `json:"user_id,omitempty"`
	ChatID user.TelegramID `json:"chat_id,omitempty"`
}

GetUser represents a command to get a user. It can be used to get a user by ID or by chatID.

type GetUserHandler

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

func NewGetUserHandler

func NewGetUserHandler(readModel GetUserReadModel) GetUserHandler

func (GetUserHandler) Handle

func (h GetUserHandler) Handle(ctx context.Context, cmd GetUser) (User, error)

type GetUserReadModel

type GetUserReadModel interface {
	GetUserByID(ctx context.Context, id uuid.UUID) (User, error)
	GetUserByChatID(ctx context.Context, chatID user.TelegramID) (User, error)
}

type ReminderTime

type ReminderTime struct {
	Hour   uint8 `json:"hour"`
	Minute uint8 `json:"minute"`
}

type Settings

type Settings struct {
	Language     string       `json:"language"`
	ReminderTime ReminderTime `json:"reminder_time"`
}

type User

type User struct {
	ID       string   `json:"id"`
	ChatID   int64    `json:"chat_id"`
	Settings Settings `json:"settings"`
}

Jump to

Keyboard shortcuts

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