schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Name      string            `yaml:"name"`
	Method    string            `yaml:"method"`
	Path      string            `yaml:"path"`
	Headers   map[string]string `yaml:"headers"`
	Requests  []Request         `yaml:"requests"`
	Responses []Response        `yaml:"responses"`
}

func (Handler) ContentType added in v0.0.2

func (h Handler) ContentType() string

type Request

type Request struct {
	Name     string `yaml:"name"`
	BodyFile string `yaml:"body"`
}

type Response

type Response struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	StatusCode  int               `yaml:"status_code"`
	Headers     map[string]string `yaml:"headers"`
	Body        string            `yaml:"body"`
}

func (Response) ContentType added in v0.0.2

func (r Response) ContentType() string

type Schema

type Schema struct {
	Version int    `yaml:"version"`
	Server  Server `yaml:"server"`
}

func Parse

func Parse(r io.Reader) (Schema, error)

type Server

type Server struct {
	BaseURL  string    `yaml:"base_url"`
	Handlers []Handler `yaml:"handlers"`
}

Jump to

Keyboard shortcuts

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