v1

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleGetGroup

func HandleGetGroup(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

func HandleGetGroups

func HandleGetGroups(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

func HandleGetMetric

func HandleGetMetric(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

func HandleGetMetrics

func HandleGetMetrics(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

func HandleGetSetupData

func HandleGetSetupData(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

HandleGetSetupData just returns the current JSON-encoded setup data

func HandleGetStatus

func HandleGetStatus(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

func HandlePatchStatus

func HandlePatchStatus(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

func HandleRunSetup

func HandleRunSetup(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

HandleRunSetup executes the runner's Setup() method and returns the result

func HandleRunTeardown

func HandleRunTeardown(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

HandleRunTeardown executes the runner's Teardown() method

func HandleSetSetupData

func HandleSetSetupData(rw http.ResponseWriter, r *http.Request, p httprouter.Params)

HandleSetSetupData just parses the JSON request body and sets the result as setup data for the runner

func NewHandler

func NewHandler() http.Handler

Types

type Check

type Check struct {
	ID     string `json:"id" yaml:"id"`
	Path   string `json:"path" yaml:"path"`
	Name   string `json:"name" yaml:"name"`
	Passes int64  `json:"passes" yaml:"passes"`
	Fails  int64  `json:"fails" yaml:"fails"`
}

func NewCheck

func NewCheck(c *lib.Check) Check

type Error

type Error api2go.Error

func (Error) Error

func (e Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	Errors []Error `json:"errors"`
}

type Group

type Group struct {
	ID     string  `json:"-" yaml:"id"`
	Path   string  `json:"path" yaml:"path"`
	Name   string  `json:"name" yaml:"name"`
	Checks []Check `json:"checks" yaml:"checks"`

	Parent   *Group   `json:"-" yaml:"-"`
	ParentID string   `json:"-" yaml:"parent-id"`
	Groups   []*Group `json:"-" yaml:"-"`
	GroupIDs []string `json:"-" yaml:"group-ids"`
}

func FlattenGroup

func FlattenGroup(g *Group) []*Group

func NewGroup

func NewGroup(g *lib.Group, parent *Group) *Group

func (Group) GetID

func (g Group) GetID() string

func (Group) GetReferencedIDs

func (g Group) GetReferencedIDs() []jsonapi.ReferenceID

func (Group) GetReferences

func (g Group) GetReferences() []jsonapi.Reference

func (*Group) SetID

func (g *Group) SetID(v string) error

func (*Group) SetToManyReferenceIDs

func (g *Group) SetToManyReferenceIDs(name string, ids []string) error

func (*Group) SetToOneReferenceID

func (g *Group) SetToOneReferenceID(name, id string) error

type Metric

type Metric struct {
	Name string `json:"-" yaml:"name"`

	Type     NullMetricType `json:"type" yaml:"type"`
	Contains NullValueType  `json:"contains" yaml:"contains"`
	Tainted  null.Bool      `json:"tainted" yaml:"tainted"`

	Sample map[string]float64 `json:"sample" yaml:"sample"`
}

func NewMetric

func NewMetric(m *stats.Metric, t time.Duration) Metric

func (Metric) GetID

func (m Metric) GetID() string

func (*Metric) SetID

func (m *Metric) SetID(id string) error

type NullMetricType

type NullMetricType struct {
	Type  stats.MetricType
	Valid bool
}

func (NullMetricType) MarshalJSON

func (t NullMetricType) MarshalJSON() ([]byte, error)

func (*NullMetricType) UnmarshalJSON

func (t *NullMetricType) UnmarshalJSON(data []byte) error

type NullSetupData

type NullSetupData struct {
	SetupData
	Data interface{} `json:"data,omitempty" yaml:"data"`
}

NullSetupData is wrapper around null to satisfy jsonapi

type NullValueType

type NullValueType struct {
	Type  stats.ValueType
	Valid bool
}

func (NullValueType) MarshalJSON

func (t NullValueType) MarshalJSON() ([]byte, error)

func (*NullValueType) UnmarshalJSON

func (t *NullValueType) UnmarshalJSON(data []byte) error

type SetupData

type SetupData struct {
	Data interface{} `json:"data" yaml:"data"`
}

SetupData is just a simple wrapper to satisfy jsonapi

func (SetupData) GetID

func (sd SetupData) GetID() string

GetID is a dummy method so we can satisfy the jsonapi.MarshalIdentifier interface

func (SetupData) GetName

func (sd SetupData) GetName() string

GetName is a dummy method so we can satisfy the jsonapi.EntityNamer interface

type Status

type Status struct {
	Status lib.ExecutionStatus `json:"status" yaml:"status"`

	Paused  null.Bool `json:"paused" yaml:"paused"`
	VUs     null.Int  `json:"vus" yaml:"vus"`
	VUsMax  null.Int  `json:"vus-max" yaml:"vus-max"`
	Stopped bool      `json:"stopped" yaml:"stopped"`
	Running bool      `json:"running" yaml:"running"`
	Tainted bool      `json:"tainted" yaml:"tainted"`
}

func NewStatus

func NewStatus(engine *core.Engine) Status

func (Status) GetID

func (s Status) GetID() string

func (Status) GetName

func (s Status) GetName() string

func (Status) SetID

func (s Status) SetID(id string) error

Source Files

  • errors.go
  • group.go
  • group_routes.go
  • metric.go
  • metric_routes.go
  • routes.go
  • setup_teardown_routes.go
  • status.go
  • status_routes.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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