dataconnector

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: GPL-3.0 Imports: 2 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

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 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 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 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