entity

package
v0.0.0-...-ead56d2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	TestDirectory string `json:"test_directory"`
	LogDirectory  string `json:"log_directory"`
	Strict        bool   `json:"strict"`
	Worker        int    `json:"worker" validate:"gte=1"`
	Status        bool   `json:"status"`
	Parse         bool   `json:"parse"`
}

Configuration alters config

func ReadConfiguration

func ReadConfiguration(fsys fs.FS, logger *log.Logger) *Configuration

ReadConfiguration searches and parses ditto configuration file in the current working directory

type Endpoint

type Endpoint struct {
	Host    string                 `json:"host" validate:"required,ip|url|hostname"`
	Method  string                 `json:"method,omitempty" validate:"oneof=GET POST PUT PATCH DELETE"`
	Query   map[string]interface{} `json:"query"`
	Body    map[string]interface{} `json:"body"`
	Headers map[string]string      `json:"headers"`
	Timeout int                    `json:"timeout" validate:"gte=0"`
}

Endpoint contains endpoint information to be tested

type FetchResult

type FetchResult struct {
	Endpoint
	Status   int         `json:"status"`
	Response interface{} `json:"response"`
}

FetchResult represents fetching result when testing endpoints

type RunnerResult

type RunnerResult struct {
	Name      string         `json:"name"`
	Error     error          `json:"error"`
	Responses []*FetchResult `json:"responses"`
}

RunnerResult wraps a test runner result

type TestData

type TestData struct {
	Name      string     `json:"name" validate:"required"`
	Endpoints []Endpoint `json:"endpoints" validate:"required,gt=1,dive"`
}

TestData defines services to be tested

type TestLog

type TestLog struct {
	RunnerResult
	Diff []diff.Changelog
}

TestLog is entity that extends `RunnerResult` by adding diff

Jump to

Keyboard shortcuts

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