postman

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestNotFound  = errors.New("request not found")
	ErrAllParsersFailed = errors.New("failed to parse collection file, all parsers failed")
)

Functions

This section is empty.

Types

type BuilderOptions added in v0.8.0

type BuilderOptions struct {
	IgnoredRequestHeaders  []string
	IgnoredResponseHeaders []string
	EnvironmentVariables   Environment
}

type Collection

type Collection struct {
	Name        string
	Description string
	Requests    []Request
	Folders     []Folder
	Structures  []StructureDefinition
}

type CollectionBuilder added in v0.8.0

type CollectionBuilder struct {
	Parsers []interface {
		CanParse(contents []byte) bool
		Parse(contents []byte, options BuilderOptions) (Collection, error)
	}
}

func (*CollectionBuilder) FromFile added in v0.8.0

func (c *CollectionBuilder) FromFile(file string, options BuilderOptions) (col Collection, err error)

type CollectionV210Parser added in v0.9.0

type CollectionV210Parser struct{}

func (*CollectionV210Parser) CanParse added in v0.9.0

func (p *CollectionV210Parser) CanParse(contents []byte) bool

func (*CollectionV210Parser) Parse added in v0.9.0

func (p *CollectionV210Parser) Parse(contents []byte, options BuilderOptions) (Collection, error)

type Environment added in v0.7.0

type Environment map[string]string

type EnvironmentBuilder added in v0.8.0

type EnvironmentBuilder struct{}

func (*EnvironmentBuilder) FromFile added in v0.8.0

func (b *EnvironmentBuilder) FromFile(file string) (Environment, error)

type Folder

type Folder struct {
	ID          string
	Name        string
	Description string
	Folders     []Folder
	Requests    []Request
}

type KeyValuePair added in v0.8.0

type KeyValuePair struct {
	Name        string
	Key         string
	Value       interface{}
	Description string
}

type Request

type Request struct {
	ID            string
	Name          string
	Description   string
	Method        string
	URL           string
	PayloadType   string
	PayloadRaw    string
	PayloadParams []KeyValuePair
	PathVariables []KeyValuePair
	Headers       []KeyValuePair
	Responses     []Response
	Tests         string
}

type Response

type Response struct {
	ID         string
	Name       string
	Status     string
	StatusCode int
	Body       string
	Headers    []KeyValuePair
}

type StructureDefinition added in v0.0.3

type StructureDefinition struct {
	Name        string
	Description string
	Fields      []StructureFieldDefinition
}

type StructureFieldDefinition added in v0.0.3

type StructureFieldDefinition struct {
	Name        string
	Description string
	Type        string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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