lexer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expectation

type Expectation struct {
	Code int
	Body string
}

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func New

func New(concurrent bool) Lexer

func (*Lexer) Parse

func (l *Lexer) Parse(scanner *bufio.Scanner) (requests []MetaRequest, variables map[string]string, err error)

parse : Parse a rest file and build golang http requests from it

type MetaRequest

type MetaRequest struct {
	Label       string
	Skip        bool
	URL         string
	Headers     map[string]string
	Method      string
	Path        string
	Body        string
	Filepath    string
	Filelabel   string
	Delay       time.Duration
	Expectation Expectation
	Reinterpret bool
	Block       []string
}

type Request

type Request struct {
	Label       string
	Skip        bool
	R           *http.Request
	Delay       time.Duration
	Expectation Expectation
}

func BuildRequest

func BuildRequest(input MetaRequest, variables map[string]string) (req Request, err error)

BuildRequest : generate http.Request from parsed input

Jump to

Keyboard shortcuts

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