testutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpContainerLogs

func DumpContainerLogs(id string) []byte

DumpContainerLogs outputs logs from the running docker container.

func Get

func Get(t *testing.T, url string, headers map[string]string) (*http.Response, error)

Get executes GET requests

func NewTestLoger

func NewTestLoger() (*zap.SugaredLogger, func())

NewTestLoger creates a new logger for testing. nolint

func Post

func Post(t *testing.T, url, body string, headers map[string]string) (*http.Response, error)

Post executes POST requests

func StopContainer

func StopContainer(id string) error

StopContainer stops and removes the specified container.

func StopDB

func StopDB(c *Container)

StopDB stops a running immudb instance.

Types

type Container

type Container struct {
	ID   string
	Host string // IP:Port
	Port int
}

Container tracks information about the docker container started for tests.

func StartContainer

func StartContainer(image, port string, args ...string) (*Container, error)

StartContainer starts the specified container for running tests.

func StartDB

func StartDB() (*Container, error)

StartDB starts a immudb instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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