postman

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCollectionName = "Root"
)

Functions

func New

func New(cfg Config) docbuilder.DocBuilder

Types

type Body

type Body struct {
	Mode       string     `json:"mode"`
	FormData   []Variable `json:"formdata"`
	URLEncoded []Variable `json:"urlencoded"`
	Raw        string     `json:"raw"`
}

Body describes a request body

type Collection

type Collection struct {
	Info      Info       `json:"info"`
	Items     []Item     `json:"item"`
	Variables []Variable `json:"variable"`
}

Collection describes the full API documentation

func (*Collection) ParseFrom

func (d *Collection) ParseFrom(rdr io.Reader) error

ParseFrom create new collection from specified reader

type Config

type Config struct{}

type Default

type Default struct {
	// contains filtered or unexported fields
}

func (*Default) Build

func (e *Default) Build(ctx context.Context, srcpath, distpath string, force bool) (err error)

type Info

type Info struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Schema      string `json:"schema"`
}

Info describes the postman info section

type Item

type Item struct {
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Items       []RequestItem `json:"item"`
	RequestItem
}

Item describes a request collection/item

type Request

type Request struct {
	Method      string     `json:"method"`
	Headers     []Variable `json:"header"`
	Body        Body       `json:"body"`
	URL         URL        `json:"url"`
	Description string     `json:"description"`
}

Request describes a request

type RequestItem

type RequestItem struct {
	Name        string        `json:"name"`
	Items       []RequestItem `json:"item"`
	Request     Request       `json:"request"`
	Responses   []Response    `json:"response"`
	IsSubFolder bool          `json:"_postman_isSubFolder"`
}

RequestItem describes a request item

type Response

type Response struct {
	ID              string     `json:"id"`
	Name            string     `json:"name"`
	OriginalRequest Request    `json:"originalRequest"`
	Status          string     `json:"status"`
	Code            int        `json:"code"`
	Headers         []Variable `json:"header"`
	Body            string     `json:"body"`
	PreviewLanguage string     `json:"_postman_previewlanguage"`
}

Response describes a request resposne

type URL

type URL struct {
	Raw         string     `json:"raw"`
	Host        []string   `json:"host"`
	Path        []string   `json:"path"`
	Description string     `json:"description"`
	Query       []Variable `json:"query"`
	Variables   []Variable `json:"variable"`
}

URL describes URL of the request

type Variable

type Variable struct {
	Key         string `json:"key"`
	Value       string `json:"value"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Disabled    bool   `json:"disabled"`
	Enabled     bool   `json:"enabled"` // this field is used by env
}

Field describes query, header, form-data and urlencoded field of request

Jump to

Keyboard shortcuts

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