models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateIsNotEmpty

func ValidateIsNotEmpty(key string, variables map[string]any) error

func ValidateIsNotNull

func ValidateIsNotNull(key string, variables map[string]any) error

func ValidateIsUUID

func ValidateIsUUID(key string, variables map[string]any) error

Types

type Assertion

type Assertion struct {
	Type     string `json:"type"`
	Variable string `json:"variable"`
}

Assertion allows assertions to be performed against variables.

type Config

type Config struct {
	Environment      Environment    `yaml:"environment"`
	Variables        map[string]any `yaml:"variables"`
	SetupRequests    []Request      `yaml:"setup_requests"`
	RequestFrequency time.Duration  `yaml:"request_frequency"`
	Requests         []Request      `yaml:"requests"`
}

Config holds the top-level configuration for the application.

type Environment

type Environment struct {
	BaseURL string `yaml:"base_url"`
}

Environment contains known, named values that configuration the application.

type Extractor

type Extractor struct {
	Type      string            `yaml:"type"`
	Selectors map[string]string `yaml:"selectors"`
}

Extractor allows values from responses to be captured and used in subsequent requests.

type Request

type Request struct {
	Name       string            `yaml:"name"`
	Headers    map[string]string `yaml:"headers"`
	Method     string            `yaml:"method"`
	Path       string            `yaml:"path"`
	Body       string            `yaml:"body"`
	Extractors []Extractor       `yaml:"extractors"`
	Assertions []Assertion       `yaml:"assertions"`
}

Request holds the configuration that will be used when making a request to an API.

type RequestResult

type RequestResult struct {
	StatusCode int
}

type RequestResults

type RequestResults []RequestResult

func (RequestResults) Log

func (rr RequestResults) Log(logger *zerolog.Logger)

type Validator

type Validator func(key string, variables map[string]any) error

Jump to

Keyboard shortcuts

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