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: 0

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