call

package
v0.0.0-...-b228417 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidArgumentsNumber is an error when the number of arguments are invalid
	ErrInvalidArgumentsNumber = errors.New("invalid number of arguments")

	// ErrInvalidUrl is an error when the format of the url is invalid
	ErrInvalidUrl = errors.New("invalid url format")
)

Functions

func ParseAttempts

func ParseAttempts(args []string, defaultAttempts int) (attempts int, err error)

Tries to parse maxAttempts number. If it wasn't possible, returns default attempts

func ParseConcurrentAttempts

func ParseConcurrentAttempts(args []string, defaultConcurrentAttempts int) (attempts int, err error)

Tries to parse the concurrent attempts number. If it wasn't possible, returns default concurrent attempts

func PrintResults

func PrintResults(result Result)

Print results formatted by Status

Types

type Call

type Call interface {
	MakeIt() map[int]int
}

A Call should know how to execute itself, generating a Result from its execution

type CallResponse

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

URL calls response

type ConcurrentCall

type ConcurrentCall struct {
	URL                *url.URL // The endpoint to be tested
	Attempts           int      // number of Attempts
	ConcurrentAttempts int      // number of concurrent Attempts
}

A ConcurrentCall represents the very basic structure to start calling some URL out. It carries all data needed to call-it operate on.

func BuildCall

func BuildCall(args []string, maxAttempts, maxConcurrentAttempts int) (call ConcurrentCall, err error)

Parses all given arguments and transform them into a ConcurrentCall

func (*ConcurrentCall) MakeIt

func (call *ConcurrentCall) MakeIt() (result Result)

Make a call and return its results

type Result

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

A Result contains the info to be outputted at the end of the operation

Jump to

Keyboard shortcuts

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