logic

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReqParamsParse

func ReqParamsParse(ctx context.Context, sdApi *sdapi.SdAPIType, defaults config.GenerationDefaults, s string, reqParams reqparams.ReqParams) (firstCmdCharAt int, err error)

Returns -1 as firstCmdCharAt if no params have been found in the given string.

Types

type CmdHandler

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

func NewCmdHandler

func NewCmdHandler(
	sdApi *sdapi.SdAPIType,
	reqQueue *reqqueue.ReqQueue,
	generationDefaults config.GenerationDefaults,
	userService userservice.UserService,
) *CmdHandler

func (*CmdHandler) AddHandlers

func (c *CmdHandler) AddHandlers(
	bot *telegram.SDBot,
)

func (*CmdHandler) GetDefaultHandler

func (c *CmdHandler) GetDefaultHandler() bot.HandlerFunc

func (*CmdHandler) Start

func (c *CmdHandler) Start(ctx context.Context, msg *models.Message)

type WriteCounter

type WriteCounter struct {
	Ctx                   context.Context
	GotBytes              int64
	TotalBytes            int64
	ProgressPrintInterval time.Duration
	LastProgressPrintAt   time.Time
	// contains filtered or unexported fields
}

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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