cmd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeValueInto

func MergeValueInto[T comparable](target *T, source T)

Types

type CommandInterface

type CommandInterface interface {
	MergeConfig(cfg config.Config)
	ValidatePostMerge() error
}

type CommonBotCliArgs

type CommonBotCliArgs struct {
	Config     string   `short:"c" help:"Configuration file path ($BOT_CONFIG_PATH)"`
	Recipients []string `short:"r" help:"Message recipients, comma separated (defaults to value from config or $BOT_RECIPIENTS)"`
	BotToken   string   `yaml:"bot_token" help:"Your bot token as given by botfather (defaults to value from config or $BOT_TOKEN)"`
}

func (*CommonBotCliArgs) MergeConfig

func (cmd *CommonBotCliArgs) MergeConfig(cfg config.Config)

func (*CommonBotCliArgs) ValidatePostMerge

func (cmd *CommonBotCliArgs) ValidatePostMerge() error

type GenerateKey

type GenerateKey struct{}

func (*GenerateKey) Run

func (cmd *GenerateKey) Run() error

type Send

type Send struct {
	CommonBotCliArgs `embed:""`
	ParseMode        string `short:"m" placeholder:"MarkdownV2" help:"Message parse mode"`
	Message          string `arg:"" optional:"" help:"Message to send. Read from STDIN if not specified"`
}

func (*Send) AfterApply

func (cmd *Send) AfterApply(ctx *kong.Context) error

func (*Send) Run

func (cmd *Send) Run() error

type Serve

type Serve struct {
	CommonBotCliArgs `embed:""`
	Address          string `arg:"" optional:"" env:"BOT_ADDR" placeholder:"localhost:6000" help:"HTTP server listening address ($BOT_ADDR)"`
	LogType          string `placeholder:"text" help:"Logger output type ($BOT_LOG_TYPE)"`
	LogLevel         string `placeholder:"info" help:"Minimum logging level ($BOT_LOG_LEVEL)"`
	ApiKey           string `help:"API key, passed in 'x-api-key' header to authorize incoming requests ($BOT_API_KEY)"`
}

func (*Serve) MergeConfig

func (cmd *Serve) MergeConfig(cfg config.Config)

func (*Serve) Run

func (cmd *Serve) Run() error

func (*Serve) ValidatePostMerge

func (cmd *Serve) ValidatePostMerge() error

type Version added in v1.2.0

type Version struct{}

func (Version) GetVersion added in v1.2.0

func (v Version) GetVersion() string

func (*Version) Run added in v1.2.0

func (cmd *Version) Run() error

Jump to

Keyboard shortcuts

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