Documentation
¶
Index ¶
Constants ¶
const (
MimePlainText = "text/plain"
)
Variables ¶
This section is empty.
Functions ¶
func NewTokenAction ¶
func NewTokenAction(t TokenType) lexmachine.Action
NewTokenAction creates a lexmachine action for the given tokentype
Types ¶
type BashishParser ¶
type BashishParser struct {
// contains filtered or unexported fields
}
BashishParser is a parser for the bashish language. Bashish is a language that is a very simple subset of bash. It is basically shell commands plus the ability to do things like pipe the output of one command to another.
func NewBashishParser ¶
func NewBashishParser() (*BashishParser, error)
NewBashishParser creates a new parser for the bashish language.
func (*BashishParser) Parse ¶
func (p *BashishParser) Parse(doc string) ([]Instruction, error)
Parse a multline string into a sequence of commands
type Executor ¶
type Executor struct {
v1alpha1.UnimplementedExecuteServiceServer
// contains filtered or unexported fields
}
Executor is responsible for executing the commands
func NewExecutor ¶
func (*Executor) Execute ¶
func (e *Executor) Execute(ctx context.Context, req *v1alpha1.ExecuteRequest) (*v1alpha1.ExecuteResponse, error)
type Instruction ¶
type Instruction struct {
Command *cmd.Cmd
// Piped should be set to true if the output of this command should be piped to the next instruction.
Piped bool
}
Instruction represents one instruction in the bashish language. This is typically a command that should be executed. In addition it contains information about how that command should be executed; e.g. if the output of this command should be piped to the next command.