transaction

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package transaction implements the main types for defining, running and emitting replicant test data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string                 `json:"name" yaml:"name"`
	Driver     string                 `json:"driver" yaml:"driver"`
	Schedule   string                 `json:"schedule" yaml:"schedule"`
	Timeout    string                 `json:"timeout" yaml:"timeout"`
	RetryCount int                    `json:"retry_count" yaml:"retry_count"`
	Script     string                 `json:"script" yaml:"script"`
	CallBack   *callback.Config       `json:"callback" yaml:"callback"`
	Inputs     map[string]interface{} `json:"inputs" yaml:"inputs"`
	Metadata   map[string]string      `json:"metadata" yaml:"metadata"`
}

Config is a synthetic test definition

type Result

type Result struct {
	UUID            string            `json:"uuid" yaml:"uuid"`
	Name            string            `json:"name" yaml:"name"`
	Driver          string            `json:"driver" yaml:"driver"`
	Failed          bool              `json:"failed" yaml:"failed"`
	Message         string            `json:"message" yaml:"message"`
	Data            string            `json:"data" yaml:"data"`
	Time            time.Time         `json:"time" yaml:"time"`
	Error           error             `json:"-" yaml:"-"`
	Metadata        map[string]string `json:"metadata" yaml:"metadata"`
	RetryCount      int               `json:"retry_count" yaml:"retry_count"`
	WithCallback    bool              `json:"with_callback" yaml:"with_callback"`
	DurationSeconds float64           `json:"duration_seconds" yaml:"duration_seconds"`
}

Result represents a transaction execution result

func (*Result) MarshalJSON

func (r *Result) MarshalJSON() (data []byte, err error)

MarshalJSON is custom marshaler for result

func (*Result) UnmarshalJSON

func (r *Result) UnmarshalJSON(data []byte) error

UnmarshalJSON is custom unmarshaler for result

type Transaction

type Transaction interface {
	Run(ctx context.Context) (result Result)
	Config() (config Config)
}

Transaction is a test executor. It can be run many times.

Directories

Path Synopsis
Package callback implements a facilities for listening to asynchronous test responses.
Package callback implements a facilities for listening to asynchronous test responses.

Jump to

Keyboard shortcuts

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