action

package
v0.0.0-...-6b7e659 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetScore  = 1
	PostScore = 20
)

Variables

This section is empty.

Functions

func Get

func Get(s *session.Session, path string, c Checker) bool

func Post

func Post(s *session.Session, path string, body []byte, headers map[string]string, c Checker) bool

func SSE

func SSE(s *session.Session, path string) (*sse.EventSource, bool)

Types

type CheckFunc

type CheckFunc func(body io.Reader, l *fails.Logger) bool

type Checker

type Checker interface {
	Check(body io.Reader, l *fails.Logger) bool
	CheckStatus(status int, l *fails.Logger) bool
}

type StatusChecker

type StatusChecker struct {
	ExpectedStatus int
	CheckFunc      CheckFunc
}

func BadRequest

func BadRequest(f CheckFunc) StatusChecker

func OK

func (StatusChecker) Check

func (sc StatusChecker) Check(body io.Reader, l *fails.Logger) bool

func (StatusChecker) CheckStatus

func (sc StatusChecker) CheckStatus(status int, l *fails.Logger) bool

Jump to

Keyboard shortcuts

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