spec

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoFilesFound error = errors.New("no_files_found")
	ErrInvalidSpec  error = errors.New("invalid_spec_format")
)

Functions

This section is empty.

Types

type Body

type Body string

func (*Body) UnmarshalJSON

func (b *Body) UnmarshalJSON(data []byte) error

type Expect

type Expect struct {
	Code    *validator.StatusCodeValidator `json:"code"`
	Headers *validator.HeaderValidator     `json:"headers"`
	Body    *validator.BodyValidator       `json:"body"`
}

type Export

type Export map[string]string

type Loader

type Loader interface {
	Load(string) []Spec
}

func NewSpecLoader

func NewSpecLoader(filereader file.Reader) Loader

type Request

type Request struct {
	Type    string            `json:"method"`
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
	Body    Body              `json:"body"`
}

type Spec

type Spec struct {
	Name  string `json:"name"`
	Steps []Step `json:"steps"`
}

func Unmarshal

func Unmarshal(data []byte) (Spec, error)

type Step

type Step struct {
	Name    string  `json:"name"`
	Request Request `json:"request"`
	Expect  Expect  `json:"expect"`
	Export  Export  `json:"export"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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