scenarios

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTPScenarioType represents type "http" for a scenario
	HTTPScenarioType = "http"
	// GraphQLScenarioType represents type "graphql" for a scenario
	GraphQLScenarioType = "graphql"
	// KafkaScenarioType represents type "kafka" for a scenario
	KafkaScenarioType = "kafka"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseGigaMockScenario

type BaseGigaMockScenario struct {
	Path   string `yaml:"path",json:"path",xml:"path"`
	Type   string `yaml:"type",json:"type",xml:"type"`
	Name   string `yaml:"name",json:"name",xml:"name"`
	Method string `yaml:"method",json:"method",xml:"method"`

	Scenarios []map[string]interface{} `yaml:"scenarios",json:"scenarios",xml:"scenarios"`
	WebHook   *webhook.WebHook         `xml:"webhook",json:"webhook",yaml:"webhook"`
}

BaseGigaMockScenario describes a base fields to parse file fields

type GigaMockHTTPScenario

type GigaMockHTTPScenario struct {
	Scenarios []HTTPScenario `yaml:"scenarios"`
}

GigaMockHTTPScenario

type HTTPScenario

type HTTPScenario struct {
	Request  HTTPScenarioRequest  `yaml:"request"`
	Response HTTPScenarioResponse `yaml:"response"`
	Delay    string               `yaml:"delay,omitempty"`
}

Scenario

func (HTTPScenario) Validate

func (hs HTTPScenario) Validate() error

type HTTPScenarioRequest

type HTTPScenarioRequest struct {
	Headers               map[string]string `yaml:"headers,omitempty"`
	QueryStringParameters map[string]string `yaml:"queryStringParameters,omitempty"`
	Cookies               map[string]string `yaml:"cookies,omitempty"`
	Body                  string            `yaml:"body,omitempty"`
}

HTTPScenarioRequest

type HTTPScenarioResponse

type HTTPScenarioResponse struct {
	Body       string            `yaml:"body,omitempty"`
	StatusCode int               `yaml:"statusCode"`
	Headers    map[string]string `yaml:"headers,omitempty"`
	Cookies    map[string]string `yaml:"cookies,omitempty"`
}

HTTPScenarioResponse

func (HTTPScenarioResponse) Validate

func (hsr HTTPScenarioResponse) Validate() error

type HTTPScenarios

type HTTPScenarios []HTTPScenario

HTTPScenarios

type KafkaScenario added in v0.1.2

type KafkaScenario struct {
	Name  string // a name of a scenario
	Host  string // a particular host to send or consume a message
	Port  string // port for a kafka server
	Topic string // name of a topic which the app should send a message
	Delay string // time duration between sending next message

	Producer *KafkaScenarioProducer
	Consumer *KafkaScenarioConsumer
}

KafkaScenario is a kafka scenario which should include Host, Port, Topic as a required fields

func (KafkaScenario) Validate added in v0.1.2

func (ks KafkaScenario) Validate() error

type KafkaScenarioConsumer added in v0.1.2

type KafkaScenarioConsumer struct {
	CLI bool
}

type KafkaScenarioProducer added in v0.1.2

type KafkaScenarioProducer struct {
	Headers   map[string]string
	Message   KafkaScenarioProducerMessage
	Partition int // kafka partition
	Retry     uint32
}

KafkaScenarioProducer is a description of fields for parsing to the current struct from map[string]interface{}

func (KafkaScenarioProducer) Validate added in v0.1.2

func (ksp KafkaScenarioProducer) Validate() error

type KafkaScenarioProducerMessage added in v0.1.2

type KafkaScenarioProducerMessage struct {
	Key   string
	Value string
}

KafkaScenarioProducerMessage

type KafkaScenarios added in v0.1.2

type KafkaScenarios []KafkaScenario

KafkaScenarios is a list of scenarios

type WebHookHTTPScenario added in v0.1.2

type WebHookHTTPScenario struct {
	Request HTTPScenarioRequest
}

WebHookHTTPScenario

type WebHookHTTPScenarios added in v0.1.2

type WebHookHTTPScenarios []WebHookHTTPScenario

WebHookHTTPScenarios is list of the WebHookHTTPScenario structures

Jump to

Keyboard shortcuts

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