models

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ActionSendHTTPMethodPOST captures enum value "POST"
	ActionSendHTTPMethodPOST string = "POST"

	// ActionSendHTTPMethodGET captures enum value "GET"
	ActionSendHTTPMethodGET string = "GET"

	// ActionSendHTTPMethodDELETE captures enum value "DELETE"
	ActionSendHTTPMethodDELETE string = "DELETE"

	// ActionSendHTTPMethodPUT captures enum value "PUT"
	ActionSendHTTPMethodPUT string = "PUT"

	// ActionSendHTTPMethodOPTIONS captures enum value "OPTIONS"
	ActionSendHTTPMethodOPTIONS string = "OPTIONS"

	// ActionSendHTTPMethodHEAD captures enum value "HEAD"
	ActionSendHTTPMethodHEAD string = "HEAD"
)
View Source
const (

	// ExpectHTTPMethodPOST captures enum value "POST"
	ExpectHTTPMethodPOST string = "POST"

	// ExpectHTTPMethodGET captures enum value "GET"
	ExpectHTTPMethodGET string = "GET"

	// ExpectHTTPMethodDELETE captures enum value "DELETE"
	ExpectHTTPMethodDELETE string = "DELETE"

	// ExpectHTTPMethodPUT captures enum value "PUT"
	ExpectHTTPMethodPUT string = "PUT"

	// ExpectHTTPMethodOPTIONS captures enum value "OPTIONS"
	ExpectHTTPMethodOPTIONS string = "OPTIONS"

	// ExpectHTTPMethodHEAD captures enum value "HEAD"
	ExpectHTTPMethodHEAD string = "HEAD"
)
View Source
const (

	// MockKindBehavior captures enum value "Behavior"
	MockKindBehavior string = "Behavior"

	// MockKindAbstractBehavior captures enum value "AbstractBehavior"
	MockKindAbstractBehavior string = "AbstractBehavior"

	// MockKindTemplate captures enum value "Template"
	MockKindTemplate string = "Template"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionDispatcher

type ActionDispatcher struct {

	// used to explicitly order the actions run when a behavior triggers
	Order int64 `json:"order,omitempty"`

	// publish amqp
	PublishAmqp *ActionPublishAMQP `json:"publish_amqp,omitempty"`

	// publish kafka
	PublishKafka *ActionPublishKafka `json:"publish_kafka,omitempty"`

	// redis
	Redis ActionRedis `json:"redis,omitempty"`

	// reply http
	ReplyHTTP *ActionReplyHTTP `json:"reply_http,omitempty"`

	// send http
	SendHTTP *ActionSendHTTP `json:"send_http,omitempty"`

	// sleep
	Sleep *ActionSleep `json:"sleep,omitempty"`
}

ActionDispatcher action dispatcher swagger:model ActionDispatcher

func (*ActionDispatcher) MarshalBinary

func (m *ActionDispatcher) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ActionDispatcher) UnmarshalBinary

func (m *ActionDispatcher) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ActionDispatcher) Validate

func (m *ActionDispatcher) Validate(formats strfmt.Registry) error

Validate validates this action dispatcher

type ActionPublishAMQP

type ActionPublishAMQP struct {

	// AMQP exchange name
	Exchange string `json:"exchange,omitempty"`

	// string payload to send on AMQP
	Payload string `json:"payload,omitempty"`

	// file path (relative to OPENMOCK_TEMPLATES_DIR of OM) to load body from
	PayloadFromFile string `json:"payload_from_file,omitempty"`

	// AMQP routing key
	RoutingKey string `json:"routing_key,omitempty"`
}

ActionPublishAMQP publish a message on AMQP if this behaviors condition is met swagger:model ActionPublishAMQP

func (*ActionPublishAMQP) MarshalBinary

func (m *ActionPublishAMQP) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ActionPublishAMQP) UnmarshalBinary

func (m *ActionPublishAMQP) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ActionPublishAMQP) Validate

func (m *ActionPublishAMQP) Validate(formats strfmt.Registry) error

Validate validates this action publish a m q p

type ActionPublishKafka

type ActionPublishKafka struct {

	// string payload to send on AMQP
	Payload string `json:"payload,omitempty"`

	// file path (relative to OPENMOCK_TEMPLATES_DIR of OM) to load body from
	PayloadFromFile string `json:"payload_from_file,omitempty"`

	// kafka topic to publish on
	Topic string `json:"topic,omitempty"`
}

ActionPublishKafka publish a message on kafka swagger:model ActionPublishKafka

func (*ActionPublishKafka) MarshalBinary

func (m *ActionPublishKafka) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ActionPublishKafka) UnmarshalBinary

func (m *ActionPublishKafka) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ActionPublishKafka) Validate

func (m *ActionPublishKafka) Validate(formats strfmt.Registry) error

Validate validates this action publish kafka

type ActionRedis

type ActionRedis []string

ActionRedis a list of redis commands to run when the swagger:model ActionRedis

func (ActionRedis) Validate

func (m ActionRedis) Validate(formats strfmt.Registry) error

Validate validates this action redis

type ActionReplyHTTP

type ActionReplyHTTP struct {

	// Text body to send over HTTP, can use templating
	Body string `json:"body,omitempty"`

	// file name (relative to working directory of OM) to load HTTP body from
	BodyFromFile string `json:"body_from_file,omitempty"`

	// map of string to string specifying HTTP headers to attach to our message
	Headers interface{} `json:"headers,omitempty"`

	// HTTP status code to reply with
	StatusCode *int64 `json:"status_code,omitempty"`
}

ActionReplyHTTP reply to incoming HTTP that triggered this behavior with a response swagger:model ActionReplyHTTP

func (*ActionReplyHTTP) MarshalBinary

func (m *ActionReplyHTTP) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ActionReplyHTTP) UnmarshalBinary

func (m *ActionReplyHTTP) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ActionReplyHTTP) Validate

func (m *ActionReplyHTTP) Validate(formats strfmt.Registry) error

Validate validates this action reply HTTP

type ActionSendHTTP

type ActionSendHTTP struct {

	// Text body to send over HTTP, can use templating
	Body string `json:"body,omitempty"`

	// file path (relative to OPENMOCK_TEMPLATES_DIR of OM) to load HTTP body from
	BodyFromFile string `json:"body_from_file,omitempty"`

	// map of string to string specifying HTTP headers to attach to our message
	Headers interface{} `json:"headers,omitempty"`

	// HTTP method to use for the send
	// Enum: [POST GET DELETE PUT OPTIONS HEAD]
	Method string `json:"method,omitempty"`

	// The URL to send HTTP to
	URL string `json:"url,omitempty"`
}

ActionSendHTTP Send a HTTP message as an action swagger:model ActionSendHTTP

func (*ActionSendHTTP) MarshalBinary

func (m *ActionSendHTTP) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ActionSendHTTP) UnmarshalBinary

func (m *ActionSendHTTP) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ActionSendHTTP) Validate

func (m *ActionSendHTTP) Validate(formats strfmt.Registry) error

Validate validates this action send HTTP

type ActionSleep

type ActionSleep struct {

	// time to wait in seconds; e.g. '1s'
	Duration string `json:"duration,omitempty"`
}

ActionSleep pause the action thread for a time swagger:model ActionSleep

func (*ActionSleep) MarshalBinary

func (m *ActionSleep) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ActionSleep) UnmarshalBinary

func (m *ActionSleep) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ActionSleep) Validate

func (m *ActionSleep) Validate(formats strfmt.Registry) error

Validate validates this action sleep

type Error

type Error struct {

	// message
	// Min Length: 1
	Message string `json:"message,omitempty"`
}

Error error swagger:model error

func (*Error) MarshalBinary

func (m *Error) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Error) UnmarshalBinary

func (m *Error) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Error) Validate

func (m *Error) Validate(formats strfmt.Registry) error

Validate validates this error

type Expect

type Expect struct {

	// amqp
	Amqp *ExpectAMQP `json:"amqp,omitempty"`

	// a go template that determines if this behavior triggers
	Condition string `json:"condition,omitempty"`

	// http
	HTTP *ExpectHTTP `json:"http,omitempty"`

	// kafka
	Kafka *ExpectKafka `json:"kafka,omitempty"`
}

Expect expect swagger:model Expect

func (*Expect) MarshalBinary

func (m *Expect) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Expect) UnmarshalBinary

func (m *Expect) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Expect) Validate

func (m *Expect) Validate(formats strfmt.Registry) error

Validate validates this expect

type ExpectAMQP

type ExpectAMQP struct {

	// TODO
	Exchange string `json:"exchange,omitempty"`

	// TODO
	Queue string `json:"queue,omitempty"`

	// TODO
	RoutingKey string `json:"routing_key,omitempty"`
}

ExpectAMQP expect a m q p swagger:model ExpectAMQP

func (*ExpectAMQP) MarshalBinary

func (m *ExpectAMQP) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ExpectAMQP) UnmarshalBinary

func (m *ExpectAMQP) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ExpectAMQP) Validate

func (m *ExpectAMQP) Validate(formats strfmt.Registry) error

Validate validates this expect a m q p

type ExpectHTTP

type ExpectHTTP struct {

	// HTTP method to expect to trigger this behavior
	// Enum: [POST GET DELETE PUT OPTIONS HEAD]
	Method string `json:"method,omitempty"`

	// HTTP path to expect to trigger this behavior
	Path string `json:"path,omitempty"`
}

ExpectHTTP expect HTTP swagger:model ExpectHTTP

func (*ExpectHTTP) MarshalBinary

func (m *ExpectHTTP) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ExpectHTTP) UnmarshalBinary

func (m *ExpectHTTP) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ExpectHTTP) Validate

func (m *ExpectHTTP) Validate(formats strfmt.Registry) error

Validate validates this expect HTTP

type ExpectKafka

type ExpectKafka struct {

	// kafka topic to listen on
	Topic string `json:"topic,omitempty"`
}

ExpectKafka expect kafka swagger:model ExpectKafka

func (*ExpectKafka) MarshalBinary

func (m *ExpectKafka) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ExpectKafka) UnmarshalBinary

func (m *ExpectKafka) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ExpectKafka) Validate

func (m *ExpectKafka) Validate(formats strfmt.Registry) error

Validate validates this expect kafka

type Health

type Health struct {

	// status
	Status string `json:"status,omitempty"`
}

Health health swagger:model health

func (*Health) MarshalBinary

func (m *Health) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Health) UnmarshalBinary

func (m *Health) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Health) Validate

func (m *Health) Validate(formats strfmt.Registry) error

Validate validates this health

type Mock

type Mock struct {

	// for behaviors, the actions this mock would do when the expect is met
	Actions []*ActionDispatcher `json:"actions"`

	// expect
	Expect *Expect `json:"expect,omitempty"`

	// for behaviors, makes this behavior extend a specified AbstractBehavior
	Extend string `json:"extend,omitempty"`

	// Unique key for the item in OM's model
	// Pattern: [\w_\-\.]+
	Key string `json:"key,omitempty"`

	// The type of item this is. possible types are: Behavior - creates a new mock behavior  AbstractBehavior - allows behaviors to use common features from this item Template - used in template language rendering to do fancy stuff
	//
	// Enum: [Behavior AbstractBehavior Template]
	Kind string `json:"kind,omitempty"`

	// a go template to be embedded in other templates
	Template string `json:"template,omitempty"`

	// Arbitrary values that can be used in go templates rendered by this item
	Values interface{} `json:"values,omitempty"`
}

Mock mock swagger:model Mock

func (*Mock) MarshalBinary

func (m *Mock) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Mock) UnmarshalBinary

func (m *Mock) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Mock) Validate

func (m *Mock) Validate(formats strfmt.Registry) error

Validate validates this mock

type Mocks

type Mocks []*Mock

Mocks collection of mocks swagger:model Mocks

func (Mocks) Validate

func (m Mocks) Validate(formats strfmt.Registry) error

Validate validates this mocks

Jump to

Keyboard shortcuts

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