telecmd

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BotToken       string
	Debug          bool
	Rules          []Rule `yaml:"rules"`
	CommandTimeout string `yaml:"commandTimeout"`
}

func (Config) CommandTimeoutDuration

func (c Config) CommandTimeoutDuration() time.Duration

func (Config) Validate

func (c Config) Validate() error

type Duration

type Duration time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type Rule

type Rule struct {
	Name             string   `yaml:"name"`
	Pattern          string   `yaml:"pattern"`
	WorkingDirectory string   `yaml:"workingDir"`
	UseStdin         bool     `yaml:"useStdin"`
	Environment      []string `yaml:"env"`
	Command          []string `yaml:"command"`
}

func (Rule) Validate

func (r Rule) Validate() error

type Telecmd

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

func New

func New(config Config) Telecmd

func (Telecmd) Run

func (t Telecmd) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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