cmd

package
v0.0.0-...-460a7fa Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Executor

func Executor(rq chan *CommandInput, wq chan *CommandOutput, cfgs []*CommandConfig)

Types

type CommandConfig

type CommandConfig struct {
	*Definition
	ReplyConfig interface{} //*pubsub.ReplyConfig
}

func NewCommandConfig

func NewCommandConfig(def *Definition, replyConfig interface{}) *CommandConfig

type CommandInput

type CommandInput struct {
	ReplyInfo interface{} // PubSubの返信に必要な構造体(PubSubの種類ごとにキャストして利用する)
	Text      string      // 起動コマンド平文
}

CommandInput はPubSubからの情報をExecutorに引き渡す構造体

type CommandOutput

type CommandOutput struct {
	ReplyInfo   interface{}
	ReplyConfig interface{}
	Text        string // コマンドからの出力
	IsErrOut    bool
	Spawned     bool
	Finished    bool
	ExitCode    int
}

CommandOutput はExecutorからの実行結果を引き渡してPubSubに書き出すための構造体

type Definition

type Definition struct {
	Timeout int
	Keyword string
	Command string
	Aliases []string
}

type Matcher

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

type OutputWriter

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

func (*OutputWriter) Flush

func (w *OutputWriter) Flush() error

func (*OutputWriter) Write

func (w *OutputWriter) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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