commands

package
v0.0.0-...-1dd25dd Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WrongFillHoursWrongIssueIDResponse    = "Введен неправильный номер задачи"
	WrongFillHoursWrongHoursCountResponse = "Введено неправильное количество часов"
)
View Source
const (
	StandardWrapValue = 20
)

Variables

This section is empty.

Functions

func SuccessFillHoursMessageResponse

func SuccessFillHoursMessageResponse(issueID int, hours float32, host string) string

Types

type Activities

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

func (*Activities) Handle

func (a *Activities) Handle(message string) (*CommandResult, error)

func (*Activities) IsCompleted

func (a *Activities) IsCompleted() bool

type BotCommandsBuilder

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

func NewBotCommandsBuilder

func NewBotCommandsBuilder(storage storage.Manager) *BotCommandsBuilder

func (BotCommandsBuilder) Build

func (b BotCommandsBuilder) Build(command string, message string, chatID int64) Command

type Builder

type Builder interface {
	Build(command string, message string, chatID int64) Command
}

type Command

type Command interface {
	Handle(message string) (*CommandResult, error)
	IsCompleted() bool
}

type CommandResult

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

func NewCommandResult

func NewCommandResult(message string) *CommandResult

func NewCommandResultWithKeyboard

func NewCommandResultWithKeyboard(message string, buttons []string) *CommandResult

func NewCommandResultWithMessages

func NewCommandResultWithMessages(messages []string) *CommandResult

func NewCommandResultWithMessagesAndKeyboard

func NewCommandResultWithMessagesAndKeyboard(messages []string, buttons []string) *CommandResult

func (*CommandResult) Buttons

func (c *CommandResult) Buttons() []string

func (*CommandResult) Message

func (c *CommandResult) Message() string

func (*CommandResult) Messages

func (c *CommandResult) Messages() []string

type FillHoursCommand

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

func NewFillHoursCommand

func NewFillHoursCommand(redmineClient redmine.Client, printer Printer, storage storage.Manager, chatID int64, message string) (*FillHoursCommand, error)

func (*FillHoursCommand) Handle

func (p *FillHoursCommand) Handle(message string) (*CommandResult, error)

func (*FillHoursCommand) HelpMessage

func (p *FillHoursCommand) HelpMessage() string

func (*FillHoursCommand) IsCompleted

func (p *FillHoursCommand) IsCompleted() bool

type FillHoursMany

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

func NewFillHoursMany

func NewFillHoursMany(redmineClient redmine.Client, storage storage.Manager, chatID int64) *FillHoursMany

func (FillHoursMany) Handle

func (f FillHoursMany) Handle(message string) (*CommandResult, error)

func (FillHoursMany) HelpMessage

func (f FillHoursMany) HelpMessage() string

func (FillHoursMany) IsCompleted

func (f FillHoursMany) IsCompleted() bool

type FillStatus

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

func NewFillStatus

func NewFillStatus(redmineClient redmine.Client, chatID int64) *FillStatus

func (FillStatus) Handle

func (f FillStatus) Handle(message string) (*CommandResult, error)

func (FillStatus) IsCompleted

func (f FillStatus) IsCompleted() bool

type IntroCommand

type IntroCommand struct {
}

func (IntroCommand) Handle

func (i IntroCommand) Handle(message string) (*CommandResult, error)

func (IntroCommand) IsCompleted

func (i IntroCommand) IsCompleted() bool

type Printer

type Printer interface {
	Print(issue redmine.Issue, printDescription bool) []string
}

type SetHostCommand

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

func (SetHostCommand) Handle

func (s SetHostCommand) Handle(message string) (*CommandResult, error)

func (SetHostCommand) IsCompleted

func (s SetHostCommand) IsCompleted() bool

type SetTokenCommand

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

func (SetTokenCommand) Handle

func (s SetTokenCommand) Handle(message string) (*CommandResult, error)

func (SetTokenCommand) IsCompleted

func (s SetTokenCommand) IsCompleted() bool

type StopCommand

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

func (StopCommand) Handle

func (s StopCommand) Handle(message string) (*CommandResult, error)

func (StopCommand) IsCompleted

func (s StopCommand) IsCompleted() bool

type UnknownCommand

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

func NewUnknownCommand

func NewUnknownCommand() *UnknownCommand

func NewUnknownCommandWithMessage

func NewUnknownCommandWithMessage(message string) *UnknownCommand

func (UnknownCommand) Handle

func (u UnknownCommand) Handle(message string) (*CommandResult, error)

func (UnknownCommand) IsCompleted

func (u UnknownCommand) IsCompleted() bool

Jump to

Keyboard shortcuts

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