mockdb

package module
v0.0.0-...-416a8b0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package mockdb implements a fully non-functional mock database client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDB

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

MockDB represents a mock database.

func Open

func Open(conn string) (*MockDB, error)

Open opens a connection to a MockDB server, defined by connection string "conn". If no connection can be established, Open returns an error. The call may get delayed by up to one second, to support demonstrating timeout behavior.

func (*MockDB) Close

func (m *MockDB) Close()

Close closes the connection to the MockDB server m.

func (*MockDB) Query

func (m *MockDB) Query(query string) ([]string, error)

Query returns a mocked result set, after an artificial delay.

func (*MockDB) Status

func (m *MockDB) Status() (string, error)

Status returns the current status of the MockDB server m. The check may fail with a certain probability, in which case Status returns an error.

Jump to

Keyboard shortcuts

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