Documentation ¶
Index ¶
- func CreatePlaybook(scriptFile *string, data []byte, playbook *config.TestDef, ...) bool
- func DisableDNSCache(discache bool)
- func DisableLogAction(noLog bool)
- func DoHTTPRequest(httpAction HTTPAction, resultsChannel chan reporter.SampleReqResult, ...) bool
- func DoMQTTRequest(mqttAction MQTTAction, resultsChannel chan reporter.SampleReqResult, ...) bool
- func DoTCPRequest(tcpAction TCPAction, resultsChannel chan reporter.SampleReqResult, ...)
- func DoUDPRequest(udpAction UDPAction, resultsChannel chan reporter.SampleReqResult, ...)
- func DoWSRequest(wsAction WSAction, resultsChannel chan reporter.SampleReqResult, ...) bool
- func GetEmbeddedFilenames() []string
- func JSONProcessor(responseHandler ResponseHandler, sessionMap map[string]string, ...) bool
- func RedecodeEscapedPath(escapedURL string) string
- func RegexpProcessor(responseHandler ResponseHandler, sessionMap map[string]string, ...) bool
- func SetContext(displaySrvResp bool, mustTraceReq bool)
- func SubstParams(sessionMap map[string]string, textData string, vulog *log.Entry) string
- func XMLPathProcessor(responseHandler ResponseHandler, sessionMap map[string]string, ...) bool
- type Action
- type AssertAction
- type FormData
- type FullAction
- type HTTPAction
- type LogAction
- type MQTTAction
- type ResponseHandler
- type SetVarAction
- type SleepAction
- type TCPAction
- type TCPReqResult
- type UDPAction
- type WSAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePlaybook ¶
func CreatePlaybook(scriptFile *string, data []byte, playbook *config.TestDef, actions *[]FullAction) bool
Create a Playbook from the YAML data
func DisableDNSCache ¶
func DisableDNSCache(discache bool)
func DisableLogAction ¶
func DisableLogAction(noLog bool)
DisableAction is called upon --no-log arg on command line
func DoHTTPRequest ¶
func DoHTTPRequest(httpAction HTTPAction, resultsChannel chan reporter.SampleReqResult, sessionMap map[string]string, vulog *log.Entry, playbook *config.TestDef) bool
DoHTTPRequest accepts a Httpaction and a one-way channel to write the results to.
func DoMQTTRequest ¶
func DoMQTTRequest(mqttAction MQTTAction, resultsChannel chan reporter.SampleReqResult, sessionMap map[string]string, vulog *log.Entry, playbook *config.TestDef) bool
DoMQTTRequest accepts a MqttAction and a one-way channel to write the results to.
func DoTCPRequest ¶
func DoTCPRequest(tcpAction TCPAction, resultsChannel chan reporter.SampleReqResult, sessionMap map[string]string, vulog *log.Entry)
DoTCPRequest accepts a TcpAction and a one-way channel to write the results to.
func DoUDPRequest ¶
func DoUDPRequest(udpAction UDPAction, resultsChannel chan reporter.SampleReqResult, sessionMap map[string]string, vulog *log.Entry)
DoUDPRequest accepts a UdpAction and a one-way channel to write the results to.
func DoWSRequest ¶
func DoWSRequest(wsAction WSAction, resultsChannel chan reporter.SampleReqResult, sessionMap map[string]string, vulog *log.Entry, playbook *config.TestDef) bool
DoWSRequest handles requests made using WebSocket Protocol TODO: manage cookies !
func GetEmbeddedFilenames ¶
func GetEmbeddedFilenames() []string
Return the list of embedded filenames
func JSONProcessor ¶
func JSONProcessor(responseHandler ResponseHandler, sessionMap map[string]string, vulog *log.Entry, responseBody []byte) bool
JSONProcessor applies JSON expression to extract data from responses and fill variables
func RedecodeEscapedPath ¶
RedecodeEscapedPath gives the canonical value of un escaped path
func RegexpProcessor ¶
func RegexpProcessor(responseHandler ResponseHandler, sessionMap map[string]string, vulog *log.Entry, responseBody []byte, respHeader http.Header) bool
RegexpProcessor applies the Regexp from responses to fill variables
func SetContext ¶
func SubstParams ¶
SubstParams compute the result of variables interpolation
func XMLPathProcessor ¶
func XMLPathProcessor(responseHandler ResponseHandler, sessionMap map[string]string, vulog *log.Entry, responseBody []byte) bool
XMLPathProcessor extracts XML data from responses to fill variables
Types ¶
type Action ¶
type Action interface { // Returns false if an error occurred during the execution Execute(resultsChannel chan reporter.SampleReqResult, sessionMap map[string]string, vulog *log.Entry, playbook *config.TestDef) bool }
Action is an interface which is able to execute a Request
type AssertAction ¶
type AssertAction struct { Expression string `yaml:"expression"` CompiledExpr *govaluate.EvaluableExpression }
AssertAction describes an assert Action
func NewAssertAction ¶
func NewAssertAction(a map[interface{}]interface{}) (AssertAction, bool)
NewAssertAction creates a new Assert Action
type FormData ¶
type FormData struct { Name string `yaml:"name"` Value string `yaml:"value"` Type string `yaml:"type"` Content []byte }
FormData describes the data that will be sent with the HTTP Request
func NewFormData ¶
NewFormData build a new structure to handle form data to be sent
func NewFormDatas ¶
NewFormDatas builds all the FormDatas from the Action described in YAML Playbook
type FullAction ¶
type FullAction struct { When string `yaml:"when"` CompiledWhen *govaluate.EvaluableExpression Action Action }
FullAction embeds the global parameters for all actions as well as an Action
func BuildActionList ¶
func BuildActionList(playbook *config.TestDef, scriptDir string) ([]FullAction, bool)
BuildActionList builds all the Actions !
type HTTPAction ¶
type HTTPAction struct { Method string `yaml:"method"` URL string `yaml:"url"` Body string `yaml:"body"` Template string `yaml:"template"` FormDatas []FormData `yaml:"formdatas"` Headers map[string]string `yaml:"headers"` Title string `yaml:"title"` StoreCookie string `yaml:"storeCookie"` ResponseHandlers []ResponseHandler `yaml:"responses"` }
HTTPAction describes a HTTP Action
func NewHTTPAction ¶
func NewHTTPAction(a map[interface{}]interface{}, dflt config.Default) (HTTPAction, bool)
NewHTTPAction creates a new HTTP Action
type LogAction ¶
type LogAction struct {
Message string `yaml:"message"`
}
LogAction describes a log Action
func NewLogAction ¶
NewLogAction creates a new Log Action
type MQTTAction ¶
type MQTTAction struct { URL string `yaml:"url"` Title string `yaml:"title"` Username string `yaml:"username"` Password string `yaml:"password"` ClientID string `yaml:"clientid"` MaxReconnectInterval time.Duration `yaml:"maxreconnectinterval"` KeepAlive time.Duration `yaml:"keppalive"` Payload string `yaml:"payload"` Qos byte `yaml:"qos"` Topic string `yaml:"topic"` CertificatePath string `yaml:"certificatepath"` PrivateKeyPath string `yaml:"privatekeypath"` TLSConfig *tls.Config }
MQTTAction describes a MQTT Action
func NewMQTTAction ¶
func NewMQTTAction(a map[interface{}]interface{}, dflt config.Default) (MQTTAction, bool)
NewMQTTAction creates a new MQTT Action
type ResponseHandler ¶
type ResponseHandler struct { FromHeader string `yaml:"from_header"` Jsonpaths []*jsonpath.Path `yaml:"jsonpath"` Xmlpath *xmlpath.Path `yaml:"xmlpath"` Regex *regexp.Regexp `yaml:"regex"` Variable string `yaml:"variable"` Index string `yaml:"index"` Defaultvalue string `yaml:"default_value"` }
ResponseHandler describes the actions to apply on returned data
func NewResponseHandler ¶
func NewResponseHandler(a map[interface{}]interface{}) (ResponseHandler, error)
NewResponseHandler builds the ResponseHandler from the Action described in YAML playbook
func NewResponseHandlers ¶
func NewResponseHandlers(a map[interface{}]interface{}) ([]ResponseHandler, bool)
NewResponseHandlers builds all the ResponseHandler from the Action described in YAML Playbook
type SetVarAction ¶
type SetVarAction struct { Variable string `yaml:"variable"` Expression string `yaml:"expression"` CompiledExpr *govaluate.EvaluableExpression }
SetVarAction describes a setvar Action
func NewSetVarAction ¶
func NewSetVarAction(a map[interface{}]interface{}) (SetVarAction, bool)
NewSetVarAction creates a new setvar Action
type SleepAction ¶
type SleepAction struct {
Duration int `yaml:"duration"` // in milli-seconds
}
SleepAction describes a sleep Action
func NewSleepAction ¶
func NewSleepAction(a map[interface{}]interface{}) (SleepAction, bool)
NewSleepAction creates a new sleep Action
type TCPAction ¶
type TCPAction struct { Address string `yaml:"address"` Payload string `yaml:"payload"` Title string `yaml:"title"` }
TCPAction describes a TCP Action
func NewTCPAction ¶
NewTCPAction createsa new TCP Action
type TCPReqResult ¶
TCPReqResult describes a TCP or UDP Result
type UDPAction ¶
type UDPAction struct { Address string `yaml:"address"` Payload string `yaml:"payload"` Title string `yaml:"title"` }
UDPAction describes a UDP Action
func NewUDPAction ¶
NewUDPAction creates a new UDP Action
type WSAction ¶
type WSAction struct { //Method string `yaml:"method"` URL string `yaml:"url"` Body string `yaml:"body"` Title string `yaml:"title"` StoreCookie string `yaml:"storeCookie"` ResponseHandlers []ResponseHandler `yaml:"responses"` }
WSAction describes the structure of WebSocket Action
func NewWSAction ¶
NewWSAction builds a new WebSocket Action
Source Files ¶
- action.go
- actionbuilder.go
- assertaction.go
- expressions.go
- httpaction.go
- httpreq.go
- interface_asserts.go
- logaction.go
- mqttaction.go
- mqttreq.go
- playbook.go
- responsehandler.go
- setvaraction.go
- sleepaction.go
- tcpaction.go
- tcpreq.go
- tcpreqresult.go
- udpaction.go
- udpreq.go
- variableprocessor.go
- wsaction.go
- wsreq.go