dataconnector

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(s Storage, name string) (*DataConnector, *Error)

Get an alias from the storage

func List

func List(s Storage) ([]DataConnector, *Error)

List all stored aliases

func SetLogger

func SetLogger(l Logger)

SetLogger if needed, default no logger

Types

type DataConnector

type DataConnector struct {
	Name     string
	URL      string
	ReadOnly bool
	Schema   string
	User     ValueHolder
	Password ValueHolder
}

DataConnector holds a name (alias) and a URI to a database.

type DataPinger

type DataPinger interface {
	Ping() *Error
}

Datapinger test connection

type DataPingerFactory

type DataPingerFactory interface {
	New(url string) DataPinger
}

DataPingerFactory create a DataPing for the given `url`

type Error

type Error struct {
	Description string
}

Error is the error type returned by the domain

func Add

func Add(s Storage, m *DataConnector) *Error

Add an alias to the storage, if it does not exist

func (*Error) Error

func (e *Error) Error() string

type Logger

type Logger interface {
	Trace(msg string)
	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(msg string)
}

Logger for events.

type MockDataPinger

type MockDataPinger struct {
	mock.Mock
}

MockDataPinger is an autogenerated mock type for the DataPinger type

func (*MockDataPinger) Ping

func (_m *MockDataPinger) Ping() *Error

Ping provides a mock function with given fields:

type MockDataPingerFactory

type MockDataPingerFactory struct {
	mock.Mock
}

MockDataPingerFactory is an autogenerated mock type for the DataPingerFactory type

func (*MockDataPingerFactory) New

New provides a mock function with given fields: url

type MockLogger

type MockLogger struct {
	mock.Mock
}

MockLogger is an autogenerated mock type for the Logger type

func (*MockLogger) Debug

func (_m *MockLogger) Debug(msg string)

Debug provides a mock function with given fields: msg

func (*MockLogger) Error

func (_m *MockLogger) Error(msg string)

Error provides a mock function with given fields: msg

func (*MockLogger) Info

func (_m *MockLogger) Info(msg string)

Info provides a mock function with given fields: msg

func (*MockLogger) Trace

func (_m *MockLogger) Trace(msg string)

Trace provides a mock function with given fields: msg

func (*MockLogger) Warn

func (_m *MockLogger) Warn(msg string)

Warn provides a mock function with given fields: msg

type MockStorage

type MockStorage struct {
	mock.Mock
}

MockStorage is an autogenerated mock type for the Storage type

func (*MockStorage) List

func (_m *MockStorage) List() ([]DataConnector, *Error)

List provides a mock function with given fields:

func (*MockStorage) Store

func (_m *MockStorage) Store(_a0 *DataConnector) *Error

Store provides a mock function with given fields: _a0

type Nologger

type Nologger struct{}

Nologger default implementation do nothing.

func (Nologger) Debug

func (l Nologger) Debug(msg string)

Debug event.

func (Nologger) Error

func (l Nologger) Error(msg string)

Error event.

func (Nologger) Info

func (l Nologger) Info(msg string)

Info event.

func (Nologger) Trace

func (l Nologger) Trace(msg string)

Trace event.

func (Nologger) Warn

func (l Nologger) Warn(msg string)

Warn event.

type Storage

type Storage interface {
	List() ([]DataConnector, *Error)
	Store(*DataConnector) *Error
}

Storage allows to store and retrieve DataConnector objects.

type ValueHolder

type ValueHolder struct {
	Value        string
	ValueFromEnv string
}

Jump to

Keyboard shortcuts

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