relation

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Description string
}

Error is the error type returned by the domain.

func Extract

func Extract(e Extractor, s Storage) *Error

Extract relations from a relational database.

func (*Error) Error

func (e *Error) Error() string

type Extractor

type Extractor interface {
	Extract() ([]Relation, *Error)
}

Extractor allows to extract relations from a relational database.

type ExtractorFactory

type ExtractorFactory interface {
	New(url string, schema string) Extractor
}

ExtractorFactory exposes methods to create new extractors.

type MockExtractor

type MockExtractor struct {
	mock.Mock
}

MockExtractor is an autogenerated mock type for the Extractor type

func (*MockExtractor) Extract

func (_m *MockExtractor) Extract() ([]Relation, *Error)

Extract provides a mock function with given fields:

type MockExtractorFactory

type MockExtractorFactory struct {
	mock.Mock
}

MockExtractorFactory is an autogenerated mock type for the ExtractorFactory type

func (*MockExtractorFactory) New

func (_m *MockExtractorFactory) New(url string, schema string) Extractor

New provides a mock function with given fields: url, schema

type MockStorage

type MockStorage struct {
	mock.Mock
}

MockStorage is an autogenerated mock type for the Storage type

func (*MockStorage) List

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

List provides a mock function with given fields:

func (*MockStorage) Store

func (_m *MockStorage) Store(relations []Relation) *Error

Store provides a mock function with given fields: relations

type Relation

type Relation struct {
	Name   string
	Parent Table
	Child  Table
}

Relation holds a parent Table and a child Table.

type Storage

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

Storage allows to store and retrieve Relations objects.

type Table

type Table struct {
	Name string
	Keys []string
}

Table holds a name (table name) and a list of keys (table columns).

Jump to

Keyboard shortcuts

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