jsonconfig

package
v0.0.0-...-93ea535 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*BasicAuth) Translate

func (a *BasicAuth) Translate() (*config.BasicAuth, error)

type Config

type Config struct {
	Scenarios     []*Scenario     `json:"scenarios"`
	Includes      json.RawMessage `json:"include"`
	Options       *Options        `json:"options"`
	GlobalRequest *GlobalRequest  `json:"global-request"`
}

func (*Config) Translate

func (c *Config) Translate(globalRequest *GlobalRequest) ([]*config.Scenario, error)

type GlobalRequest

type GlobalRequest struct {
	BaseURL string                     `json:"base-url"`
	Auth    *BasicAuth                 `json:"auth"`
	Headers map[string]json.RawMessage `json:"headers"`
}

type JQValueExtractor

type JQValueExtractor struct {
	Expr   string          `json:"expr"`
	IsList bool            `json:"list"`
	Assert json.RawMessage `json:"assert"`
	Header string          `json:"header"`
}

type JSONSchemaValueAssertion

type JSONSchemaValueAssertion struct {
	Schema string `json:"schema"`
}

type Options

type Options struct {
	ForceSequential bool `json:"force-sequential"`
	MaxParallelism  int  `json:"max-parallelism"`
}

func (*Options) Translate

func (o *Options) Translate() (*config.Options, error)

type Override

type Override struct {
	Options *Options `json:"options"`
}

func (*Override) Translate

func (c *Override) Translate() (*config.Override, error)

type RegexValueAssertion

type RegexValueAssertion struct {
	Pattern string `json:"pattern"`
}

type RegexValueExtractor

type RegexValueExtractor struct {
	Pattern string          `json:"pattern"`
	Assert  json.RawMessage `json:"assert"`
	Header  string          `json:"header"`
}

type Request

type Request struct {
	URI     string                     `json:"uri"`
	Method  string                     `json:"method"`
	Auth    *BasicAuth                 `json:"auth"`
	Headers map[string]json.RawMessage `json:"headers"`
	Body    string                     `json:"body"`
	// TODO - this quotes in a way that is bad
	JSONBody json.RawMessage `json:"json-body"`
}

func (*Request) Translate

func (r *Request) Translate(globalRequest *GlobalRequest) (*config.Request, error)

type Response

type Response struct {
	Status  json.RawMessage            `json:"status"`
	Extract map[string]json.RawMessage `json:"extract"`
}

func (*Response) Translate

func (r *Response) Translate() (*config.Response, error)

type Scenario

type Scenario struct {
	Name         string          `json:"name"`
	Enabled      *bool           `json:"enabled"`
	Dependencies json.RawMessage `json:"dependencies"`
	Parallel     bool            `json:"parallel"`
	Tests        []*Test         `json:"tests"`
}

func (*Scenario) Translate

func (s *Scenario) Translate(globalRequest *GlobalRequest) (*config.Scenario, error)

type Test

type Test struct {
	Name          string    `json:"name"`
	Enabled       *bool     `json:"enabled"`
	Request       *Request  `json:"request"`
	Response      *Response `json:"response"`
	Retries       int       `json:"retries"`
	RetryInterval float64   `json:"retry-interval"`
}

func (*Test) Translate

func (t *Test) Translate(globalRequest *GlobalRequest) (*config.Test, error)

type TypeEnvelope

type TypeEnvelope struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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