Documentation
¶
Index ¶
- func ApplyTemplateFile(name, filename string, data interface{}) (string, error)
- func ApplyTemplateText(name, text string, data interface{}) (string, error)
- func CreateScaffold(dirname string) error
- func StartHttpServer(addr string, config *Config, cors, tls bool, cert, key string, ...) error
- func TryConversation(request *Request, command *Command, response *Response, reporter Reporter, ...)
- func TryRunRobots(upgrade *Upgrade, robots *Robots, reporter Reporter, w http.ResponseWriter, ...)
- type CliReporter
- func (r CliReporter) Error(s string)
- func (r CliReporter) Errorf(format string, a ...interface{})
- func (r CliReporter) Info(s string)
- func (r CliReporter) Infof(format string, a ...interface{})
- func (r CliReporter) IsEnabled() bool
- func (r CliReporter) Warn(s string)
- func (r CliReporter) Warnf(format string, a ...interface{})
- type Command
- type CommandInConversation
- type Config
- type ConfigItem
- type Conversation
- func (c *Conversation) GetByIndex(values []string, index int) string
- func (c *Conversation) GetByKey(values map[string][]string, key string) []string
- func (c *Conversation) JoinWith(values []string, sep string) string
- func (c *Conversation) ReadFile(filename string) string
- func (c *Conversation) ReadFiles(filename string) []string
- type Cookie
- type NoopReporter
- func (r NoopReporter) Error(s string)
- func (r NoopReporter) Errorf(format string, a ...interface{})
- func (r NoopReporter) Info(s string)
- func (r NoopReporter) Infof(format string, a ...interface{})
- func (r NoopReporter) IsEnabled() bool
- func (r NoopReporter) Warn(s string)
- func (r NoopReporter) Warnf(format string, a ...interface{})
- type Reporter
- type Request
- type RequestInConversation
- type Response
- type RobotFactory
- type RobotItem
- type Robots
- type SourceOrSink
- type Transform
- type Upgrade
- type UpgradedConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTemplateFile ¶
func ApplyTemplateText ¶
func CreateScaffold ¶
func StartHttpServer ¶
func TryConversation ¶
func TryRunRobots ¶
Types ¶
type CliReporter ¶
func (CliReporter) Error ¶
func (r CliReporter) Error(s string)
func (CliReporter) Errorf ¶
func (r CliReporter) Errorf(format string, a ...interface{})
func (CliReporter) Info ¶
func (r CliReporter) Info(s string)
func (CliReporter) Infof ¶
func (r CliReporter) Infof(format string, a ...interface{})
func (CliReporter) IsEnabled ¶
func (r CliReporter) IsEnabled() bool
func (CliReporter) Warn ¶
func (r CliReporter) Warn(s string)
func (CliReporter) Warnf ¶
func (r CliReporter) Warnf(format string, a ...interface{})
type Command ¶
type Command struct {
Env []string `yaml:",omitempty"`
Path string `yaml:",omitempty"`
Args []string `yaml:",omitempty"`
}
func (*Command) Execute ¶
func (c *Command) Execute(conversation *Conversation) error
type CommandInConversation ¶
type CommandInConversation struct {
Env []string
Path string
Args []string
Dir string
Stdout string
Stderr string
}
func (*CommandInConversation) ParseStderrAsJson ¶
func (c *CommandInConversation) ParseStderrAsJson() interface{}
func (*CommandInConversation) ParseStderrAsYaml ¶
func (c *CommandInConversation) ParseStderrAsYaml() interface{}
func (*CommandInConversation) ParseStdoutAsJson ¶
func (c *CommandInConversation) ParseStdoutAsJson() interface{}
func (*CommandInConversation) ParseStdoutAsYaml ¶
func (c *CommandInConversation) ParseStdoutAsYaml() interface{}
type Config ¶
type Config []ConfigItem
func (*Config) SaveToFile ¶
func (*Config) SelectConfigItem ¶
type ConfigItem ¶
type Conversation ¶
type Conversation struct {
Request RequestInConversation
Command CommandInConversation
}
func (*Conversation) GetByIndex ¶
func (c *Conversation) GetByIndex(values []string, index int) string
func (*Conversation) GetByKey ¶
func (c *Conversation) GetByKey(values map[string][]string, key string) []string
func (*Conversation) ReadFile ¶
func (c *Conversation) ReadFile(filename string) string
func (*Conversation) ReadFiles ¶
func (c *Conversation) ReadFiles(filename string) []string
type NoopReporter ¶
type NoopReporter struct{}
func (NoopReporter) Error ¶
func (r NoopReporter) Error(s string)
func (NoopReporter) Errorf ¶
func (r NoopReporter) Errorf(format string, a ...interface{})
func (NoopReporter) Info ¶
func (r NoopReporter) Info(s string)
func (NoopReporter) Infof ¶
func (r NoopReporter) Infof(format string, a ...interface{})
func (NoopReporter) IsEnabled ¶
func (r NoopReporter) IsEnabled() bool
func (NoopReporter) Warn ¶
func (r NoopReporter) Warn(s string)
func (NoopReporter) Warnf ¶
func (r NoopReporter) Warnf(format string, a ...interface{})
type Reporter ¶
type Reporter interface {
IsEnabled() bool
Info(string)
Infof(format string, a ...interface{})
Warn(string)
Warnf(format string, a ...interface{})
Error(string)
Errorf(format string, a ...interface{})
}
func NewReporter ¶
type Request ¶
type RequestInConversation ¶
type RequestInConversation struct {
Method string
URL *url.URL
Headers map[string][]string
RemoteAddr string
Body string
Form map[string][]string
}
func (*RequestInConversation) ParseBodyAsJson ¶
func (r *RequestInConversation) ParseBodyAsJson() interface{}
func (*RequestInConversation) ParseBodyAsYaml ¶
func (r *RequestInConversation) ParseBodyAsYaml() interface{}
type Response ¶
type Response struct {
Status int `yaml:",omitempty"`
Headers map[string]string `yaml:",omitempty"`
Cookies []Cookie `yaml:",omitempty"`
Body string `yaml:",omitempty"`
Template string `yaml:",omitempty"`
File string `yaml:",omitempty"`
}
func (*Response) Write ¶
func (r *Response) Write(conversation *Conversation, writer http.ResponseWriter) error
type RobotFactory ¶
type RobotFactory struct {
Connection UpgradedConnection
}
type RobotItem ¶
type RobotItem struct {
Source SourceOrSink
Transform Transform
Sink SourceOrSink
}
type Robots ¶
type Robots []RobotItem
func (*Robots) Run ¶
func (r *Robots) Run(robotFactory *RobotFactory)
type SourceOrSink ¶
Click to show internal directories.
Click to hide internal directories.