postman

package
v0.0.0-...-5341101 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_EXT      = "postman_environment.json"
	COLL_EXT     = "postman_collection.json"
	SCHEMA_2_1_0 = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
)
View Source
const PostmanCollectionSuffix = "postman_collection.json"
View Source
const PostmanEnvSuffix = ".postman_environment.json"

Variables

This section is empty.

Functions

func IsCollectionFile

func IsCollectionFile(filename string) bool

func IsEnvironmentFile

func IsEnvironmentFile(filename string) bool

func NewRequestSpec

func NewRequestSpec(pmReq *Request) *gpmodel.RequestSpec

func ParseCollection

func ParseCollection(filename string) (*gpmodel.RequestGroup, error)

func ParseEnvironment

func ParseEnvironment(filename string) (*gpmodel.VarGroup, error)

func Print

func Print(coll *Collection)

Types

type Body

type Body struct {
	Mode    string       `json:"mode"`
	Raw     string       `json:"raw"`
	Options *BodyOptions `json:"options"`
}

type BodyOptionRaw

type BodyOptionRaw struct {
	Language string `json:"language"`
}

type BodyOptions

type BodyOptions struct {
	Raw BodyOptionRaw `json:"raw"`
}

type Collection

type Collection struct {
	Name    string          `json:"name"`
	Info    *CollectionInfo `json:"info"`
	Items   []*Collection   `json:"item"`
	Events  []Event         `json:"event"`
	Request *Request        `json:"request"`
}

func (*Collection) Label

func (c *Collection) Label() string

type CollectionInfo

type CollectionInfo struct {
	PostmanId string `json:"_postman_id"`
	Name      string `json:"name"`
	Schema    string `json:"schema"`
}

type EnvVal

type EnvVal struct {
	Key     string `json:"key"`
	Value   string `json:"value"`
	Enabled bool   `json:"enabled"`
}

type Environment

type Environment struct {
	Id                   string    `json:"id"`
	Name                 string    `json:"name"`
	Values               []EnvVal  `json:"values"`
	PostmanVariableScope string    `json:"_postman_variable_scope"`
	PostmanExportedAt    time.Time `json:"_postman_exported_at"`
	PostmanExportedUsing string    `json:"_postman_exported_using"`
}

type Event

type Event struct {
	Listen string `json:"listen"`
	Script Script `json:"script"`
}
type Header struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	Type     string `json:"type"`
	Warning  string `json:"warning"`
	Disabled bool   `json:"disabled"`
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ProtocolProfileBehavior

type ProtocolProfileBehavior struct {
	DisableBodyPruning bool `json:"disableBodyPruning"`
}

type Request

type Request struct {
	Method    string     `json:"method"`
	Header    []Header   `json:"header"`
	Url       Url        `json:"url"`
	Body      *Body      `json:"body"`
	Variables []KeyValue `json:"variable"`
}

type Script

type Script struct {
	Id    string   `json:"id"`
	Lines []string `json:"exec"`
	Type  string   `json:"type"`
}

func (*Script) String

func (s *Script) String() string

type Url

type Url struct {
	Raw   string     `json:"raw"`
	Host  []string   `json:"host"`
	Path  []string   `json:"path"`
	Query []KeyValue `json:"query"`
}

Jump to

Keyboard shortcuts

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