collection

package
v0.0.0-...-b29bedc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

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

Body describes a request body

type Collection

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

Collection describes a request collection/item

type Documentation

type Documentation struct {
	Info        Info         `json:"info"`
	Collections []Collection `json:"item"`
	Variables   []Field      `json:"variable"`
}

Documentation describes the full API documentation

func (*Documentation) Open

func (d *Documentation) Open(rdr io.Reader) error

Open open a new collection reader

func (*Documentation) SortCollections

func (d *Documentation) SortCollections()

SortCollections sorts the collections in the alphabetical order(except for the default)

type Environment

type Environment struct {
	ID                   json.RawMessage `json:"id"`
	Name                 string          `json:"name"`
	Values               []Field         `json:"values"`
	PostmanVariableScope json.RawMessage `json:"_postman_variable_scope"`
	PostmanExportedAt    json.RawMessage `json:"_postman_exported_at"`
	PostmanExportedUsing json.RawMessage `json:"_postman_exported_using"`
}

Environment represents environment variables

func (*Environment) Open

func (e *Environment) Open(rdr io.Reader) error

Open open an environment file

func (*Environment) SetCollectionVariables

func (e *Environment) SetCollectionVariables(vv []Field)

SetCollectionVariables set collection variables to the env // if env provided then the values will be replaced

type Field

type Field 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

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"`
	Items       []Item     `json:"item"`
	Request     Request    `json:"request"`
	Responses   []Response `json:"response"`
	IsSubFolder bool       `json:"_postman_isSubFolder"`
}

Item describes a request item

type Request

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

Request describes a request

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         []Field `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       []Field  `json:"query"`
	Variables   []Field  `json:"variable"`
}

URL describes URL of the request

Jump to

Keyboard shortcuts

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