venom

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTP = struct {
	Get      func(url, path string) P
	Post     func(url, path string, body []byte) P
	PostJSON func(url, path string, body interface{}) P
	Put      func(url, path string, body []byte) P
	PutJSON  func(url, path string, body interface{}) P
	Delete   func(url, path string) P
}{
	Get: func(url, path string) P {
		return P{
			"type":   "http",
			"method": "GET",
			"url":    url,
			"path":   path,
		}
	},
	Post: func(url, path string, body []byte) P {
		return P{
			"type":   "http",
			"method": "POST",
			"url":    url,
			"path":   path,
			"body":   string(body),
		}
	},
	PostJSON: func(url, path string, body interface{}) P {
		b, err := json.Marshal(body)
		if err != nil {
			panic(err)
		}
		return P{
			"type":   "http",
			"method": "POST",
			"url":    url,
			"path":   path,
			"body":   string(b),
		}
	},
	Put: func(url, path string, body []byte) P {
		return P{
			"type":   "http",
			"method": "PUT",
			"url":    url,
			"path":   path,
			"body":   string(body),
		}
	},
	PutJSON: func(url, path string, body interface{}) P {
		b, err := json.Marshal(body)
		if err != nil {
			panic(err)
		}
		return P{
			"type":   "http",
			"method": "PUT",
			"url":    url,
			"path":   path,
			"body":   string(b),
		}
	},
	Delete: func(url, path string) P {
		return P{
			"type":   "http",
			"method": "DELETE",
			"url":    url,
			"path":   path,
		}
	},
}

Functions

This section is empty.

Types

type Logger

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

Logger is a superset of the testing Logger compliant with logrus Entry

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

Debugf calls testing.T.Logf

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf calls testing.T.Logf

func (*Logger) Fatalf

func (l *Logger) Fatalf(format