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