 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func ApiURLOasToPostman(urlWithOasVars string) string
- func DefaultMediaTypePreferencesSlice() []string
- type Collection
- type CollectionInfo
- type Description
- type Event
- type Header
- type Item
- type Request
- type RequestBody
- type Script
- type URL
- type URLEncodedParam
- type URLParameters
- type URLQuery
- type URLVariable
- type URLVariableDescription
Constants ¶
      View Source
      
  
    const ( SchemaURL210 = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" SchemaURL200 = "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" )
      View Source
      
  
const DefaultMediaTypePreferences string = `multipart/form-data,application/json,application/x-www-form-urlencoded,application/xml,text/plain`
    Variables ¶
This section is empty.
Functions ¶
func ApiURLOasToPostman ¶ added in v1.12.0
noinspection ALL
func DefaultMediaTypePreferencesSlice ¶
func DefaultMediaTypePreferencesSlice() []string
noinspection ALL
Types ¶
type Collection ¶
type Collection struct {
	Info  CollectionInfo `json:"info"`
	Item  []*Item        `json:"item"`
	Event []Event        `json:"event,omitempty"`
}
    func NewCollectionFromBytes ¶
func NewCollectionFromBytes(data []byte) (Collection, error)
func (*Collection) GetOrNewFolder ¶
func (col *Collection) GetOrNewFolder(folderName string) *Item
func (*Collection) Inflate ¶
func (col *Collection) Inflate()
func (*Collection) InflateRawURLs ¶
func (col *Collection) InflateRawURLs()
func (*Collection) SetFolder ¶
func (col *Collection) SetFolder(newFolder *Item)
type CollectionInfo ¶
type Description ¶
type Description struct {
	Content string `json:"content,omitempty"`
	Type    string `json:"type,omitempty"`
	Version string `json:"version,omitempty"`
}
    func (*Description) Inflate ¶
func (desc *Description) Inflate()
type Header ¶
type Header struct {
	Key         string `json:"key,omitempty"`
	Value       string `json:"value,omitempty"`
	Description string `json:"description,omitempty"`
}
    type Item ¶
type Item struct {
	Name        string       `json:"name,omitempty"`                 // Folder,Operation
	Description *Description `json:"description,omitempty"`          // Folder
	Item        []*Item      `json:"item,omitempty"`                 // Folder
	IsSubFolder bool         `json:"_postman_isSubFolder,omitempty"` // Folder
	Event       []Event      `json:"event,omitempty"`                // Operation
	Request     *Request     `json:"request,omitempty"`              // Operation
}
    Item can represent a folder or an API
func (*Item) UpsertSubItem ¶
type Request ¶
type Request struct {
	URL         *URL         `json:"url,omitempty"`
	Method      string       `json:"method,omitempty"`
	Header      []Header     `json:"header,omitempty"`
	Body        *RequestBody `json:"body,omitempty"`
	Description string       `json:"description,omitempty"`
}
    type RequestBody ¶
type RequestBody struct {
	Mode       string            `json:"mode,omitempty"` // `raw`, `urlencoded`, `formdata`,`file`,`graphql`
	Raw        string            `json:"raw,omitempty"`
	URLEncoded []URLEncodedParam `json:"urlencoded,omitempty"`
}
    type URL ¶
type URL struct {
	Raw      string            `json:"raw,omitempty"`
	Protocol string            `json:"protocol,omitempty"`
	Auth     map[string]string `json:"auth,omitempty"`
	Host     []string          `json:"host,omitempty"`
	Path     []string          `json:"path,omitempty"`
	Query    []URLQuery        `json:"query,omitempty"`
	Variable []URLVariable     `json:"variable,omitempty"`
}
    URL is the Postman URL used in the Postman 2.0 Collection Spec.
func NewURLForGoURL ¶ added in v1.12.0
func (*URL) AddVariable ¶
AddVariable adds a Postman Variable to the struct.
type URLEncodedParam ¶
type URLParameters ¶
type URLParameters struct {
	Query    []URLQuery    `json:"query,omitempty"`
	Variable []URLVariable `json:"variable,omitempty"`
}
    URLParameters is a temp struct to hold parsed parameters.
func NewURLParameters ¶
func NewURLParameters() URLParameters
NewURLParameters returns an initialized empty struct. noinspection ALL
type URLVariable ¶
type URLVariable struct {
	Key         string                 `json:"key,omitempty"`
	Value       interface{}            `json:"value,omitempty"`
	Description URLVariableDescription `json:"description,omitempty"`
	Disabled    bool                   `json:"disabled,omitempty"`
	ID          string                 `json:"id,omitempty"` // Old, pre 2.0.1
}
    type URLVariableDescription ¶
 Click to show internal directories. 
   Click to hide internal directories.