Documentation ¶
Overview ¶
Package context provides the test context of scenarigo.
Index ¶
- type Context
- func (c *Context) EnabledColor() bool
- func (ctx *Context) ExecuteTemplate(i interface{}) (interface{}, error)
- func (c *Context) ExtractByKey(key string) (interface{}, bool)
- func (c *Context) Node() ast.Node
- func (c *Context) PluginDir() string
- func (c *Context) Plugins() Plugins
- func (c *Context) Reporter() reporter.Reporter
- func (c *Context) Request() interface{}
- func (c *Context) RequestContext() context.Context
- func (c *Context) Response() interface{}
- func (c *Context) Run(name string, f func(*Context)) bool
- func (c *Context) Vars() Vars
- func (c *Context) WithEnabledColor(enabledColor bool) *Context
- func (c *Context) WithNode(node ast.Node) *Context
- func (c *Context) WithPluginDir(path string) *Context
- func (c *Context) WithPlugins(ps map[string]interface{}) *Context
- func (c *Context) WithReporter(r reporter.Reporter) *Context
- func (c *Context) WithRequest(req interface{}) *Context
- func (c *Context) WithRequestContext(reqCtx context.Context) *Context
- func (c *Context) WithResponse(resp interface{}) *Context
- func (c *Context) WithVars(v interface{}) *Context
- type Plugins
- type Vars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context represents a scenarigo context.
func (*Context) EnabledColor ¶ added in v0.3.0
EnabledColor returns whether color output is enabled
func (*Context) ExecuteTemplate ¶
ExecuteTemplate executes template strings in context. nolint:stylecheck
func (*Context) ExtractByKey ¶
ExtractByKey implements query.KeyExtractor interface.
func (*Context) RequestContext ¶
RequestContext returns the context.Context for request.
func (*Context) WithEnabledColor ¶ added in v0.3.0
WithEnabledColor returns a copy of c with enabledColor flag
func (*Context) WithPluginDir ¶
WithPluginDir returns a copy of c with plugin root directory.
func (*Context) WithPlugins ¶
WithPlugins returns a copy of c with ps.
func (*Context) WithReporter ¶
WithReporter returns a copy of c with new test reporter.
func (*Context) WithRequest ¶
WithRequest returns a copy of c with request.
func (*Context) WithRequestContext ¶
WithRequestContext returns the context.Context for request.
func (*Context) WithResponse ¶
WithResponse returns a copy of c with response.
type Plugins ¶
type Plugins []map[string]interface{}
Plugins represents plugins.
func (Plugins) ExtractByKey ¶
ExtractByKey implements query.KeyExtractor interface.