instance

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver     string `json:"driver"`
	Connection string `json:"connection"`
}

Config is the structure of the configuration for a single SQL database instance.

type Instance

type Instance interface {
	GetName() string
	GetQueryResults(ctx context.Context, query string) ([]map[string]any, []string, error)
}

func New

func New(name string, options map[string]any) (Instance, error)

New returns a new Elasticsearch instance for the given configuration.

type MockInstance

type MockInstance struct {
	mock.Mock
}

MockInstance is an autogenerated mock type for the Instance type

func NewMockInstance

func NewMockInstance(t NewMockInstanceT) *MockInstance

NewMockInstance creates a new instance of MockInstance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockInstance) GetName

func (_m *MockInstance) GetName() string

GetName provides a mock function with given fields:

func (*MockInstance) GetQueryResults

func (_m *MockInstance) GetQueryResults(ctx context.Context, query string) ([]map[string]interface{}, []string, error)

GetQueryResults provides a mock function with given fields: ctx, query

type NewMockInstanceT

type NewMockInstanceT interface {
	mock.TestingT
	Cleanup(func())
}

Jump to

Keyboard shortcuts

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