fsm

package
v0.0.0-...-2885a4d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Combine

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

func NewCombine

func NewCombine(resultMachine Machine, machines ...Machine) *Combine

func (*Combine) Switch

func (c *Combine) Switch(ctx context.Context, state State) (context.Context, Machine, State, error)

type Deps

type Deps struct {
	SessionRepo iface.SessionRepo
	Sender      iface.Sender
	Logger      *slog.Logger
	Cfg         config.Config
	DoneService *service.Done
}

func NewDeps

func NewDeps(cfg config.Config, sessionRepo iface.SessionRepo, sender iface.Sender, doneService *service.Done, logger *slog.Logger) *Deps

type Machine

type Machine interface {
	Switch(ctx context.Context, state State) (context.Context, Machine, State, error)
}

type State

type State struct {
	User    model.User
	Session model.Session
	Update  tgbotapi.Update
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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