id

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPullerPlan

func GetPullerPlan(storage Storage) (PullerPlan, *Error)

GetPullerPlan returns the calculated puller plan.

Types

type Cycle

type Cycle interface {
	IngressRelationList
}

A Cycle in the puller plan.

type CycleList

type CycleList interface {
	Len() uint
	Cycle(idx uint) Cycle
	String() string
}

A CycleList in the puller plan.

func NewCycleList

func NewCycleList(cycles []IngressRelationList) CycleList

NewCycleList initialize a new CycleList object

type Error

type Error struct {
	Description string
}

Error is the error type returned by the domain

func Create

func Create(startTable string, relReader RelationReader, storage Storage) *Error

Create and store ingress descriptor for the given start table and relation set.

func Export

func Export(storage Storage, exporter Exporter) *Error

Export the puller plan.

func SetChildLookup

func SetChildLookup(relation string, flag bool, storage Storage) *Error

SetChildLookup update child lookup relation's parameter in ingress descriptor

func SetParentLookup

func SetParentLookup(relation string, flag bool, storage Storage) *Error

SetParentLookup update parent lookup relation's parameter in ingress descriptor

func SetStartTable

func SetStartTable(table Table, storage Storage) *Error

SetStartTable update ingress descriptor start table

func (*Error) Error

func (e *Error) Error() string

type Exporter

type Exporter interface {
	Export(PullerPlan) *Error
}

Exporter export the puller plan.

type IngressDescriptor

type IngressDescriptor interface {
	StartTable() Table
	Relations() IngressRelationList
	String() string
}

IngressDescriptor from which the puller plan will be computed.

func NewIngressDescriptor

func NewIngressDescriptor(start Table, relations IngressRelationList) IngressDescriptor

NewIngressDescriptor initialize a new IngressDescriptor object

type IngressRelation

type IngressRelation interface {
	Relation
	LookUpChild() bool
	LookUpParent() bool
}

IngressRelation describe how a relation will be accessed.

func NewIngressRelation

func NewIngressRelation(rel Relation, lookUpParent bool, lookUpChild bool) IngressRelation

NewIngressRelation initialize a new IngressRelation object

type IngressRelationList

type IngressRelationList interface {
	Len() uint
	Relation(idx uint) IngressRelation
	Contains(string) bool
	String() string
}

IngressRelationList involved in an puller plan.

func NewIngressRelationList

func NewIngressRelationList(relations []IngressRelation) IngressRelationList

NewIngressRelationList initialize a new IngressRelationList object

type MockCycle

type MockCycle struct {
	mock.Mock
}

MockCycle is an autogenerated mock type for the Cycle type

func (*MockCycle) Contains

func (_m *MockCycle) Contains(_a0 string) bool

Contains provides a mock function with given fields: _a0

func (*MockCycle) Len

func (_m *MockCycle) Len() uint

Len provides a mock function with given fields:

func (*MockCycle) Relation

func (_m *MockCycle) Relation(idx uint) IngressRelation

Relation provides a mock function with given fields: idx

func (*MockCycle) String

func (_m *MockCycle) String() string

String provides a mock function with given fields:

type MockCycleList

type MockCycleList struct {
	mock.Mock
}

MockCycleList is an autogenerated mock type for the CycleList type

func (*MockCycleList) Cycle

func (_m *MockCycleList) Cycle(idx uint) Cycle

Cycle provides a mock function with given fields: idx

func (*MockCycleList) Len

func (_m *MockCycleList) Len() uint

Len provides a mock function with given fields:

func (*MockCycleList) String

func (_m *MockCycleList) String() string

String provides a mock function with given fields:

type MockExporter

type MockExporter struct {
	mock.Mock
}

MockExporter is an autogenerated mock type for the Exporter type

func (*MockExporter) Export

func (_m *MockExporter) Export(_a0 PullerPlan) *Error

Export provides a mock function with given fields: _a0

type MockIngressDescriptor

type MockIngressDescriptor struct {
	mock.Mock
}

MockIngressDescriptor is an autogenerated mock type for the IngressDescriptor type

func (*MockIngressDescriptor) Relations

Relations provides a mock function with given fields:

func (*MockIngressDescriptor) StartTable

func (_m *MockIngressDescriptor) StartTable() Table

StartTable provides a mock function with given fields:

func (*MockIngressDescriptor) String

func (_m *MockIngressDescriptor) String() string

String provides a mock function with given fields:

type MockIngressRelation

type MockIngressRelation struct {
	mock.Mock
}

MockIngressRelation is an autogenerated mock type for the IngressRelation type

func (*MockIngressRelation) Child

func (_m *MockIngressRelation) Child() Table

Child provides a mock function with given fields:

func (*MockIngressRelation) LookUpChild

func (_m *MockIngressRelation) LookUpChild() bool

LookUpChild provides a mock function with given fields:

func (*MockIngressRelation) LookUpParent

func (_m *MockIngressRelation) LookUpParent() bool

LookUpParent provides a mock function with given fields:

func (*MockIngressRelation) Name

func (_m *MockIngressRelation) Name() string

Name provides a mock function with given fields:

func (*MockIngressRelation) Parent

func (_m *MockIngressRelation) Parent() Table

Parent provides a mock function with given fields:

func (*MockIngressRelation) String

func (_m *MockIngressRelation) String() string

String provides a mock function with given fields:

type MockIngressRelationList

type MockIngressRelationList struct {
	mock.Mock
}

MockIngressRelationList is an autogenerated mock type for the IngressRelationList type

func (*MockIngressRelationList) Contains

func (_m *MockIngressRelationList) Contains(_a0 string) bool

Contains provides a mock function with given fields: _a0

func (*MockIngressRelationList) Len

func (_m *MockIngressRelationList) Len() uint

Len provides a mock function with given fields:

func (*MockIngressRelationList) Relation

func (_m *MockIngressRelationList) Relation(idx uint) IngressRelation

Relation provides a mock function with given fields: idx

func (*MockIngressRelationList) String

func (_m *MockIngressRelationList) String() string

String provides a mock function with given fields:

type MockPullerPlan

type MockPullerPlan struct {
	mock.Mock
}

MockPullerPlan is an autogenerated mock type for the PullerPlan type

func (*MockPullerPlan) Len

func (_m *MockPullerPlan) Len() uint

Len provides a mock function with given fields:

func (*MockPullerPlan) Relations

func (_m *MockPullerPlan) Relations() IngressRelationList

Relations provides a mock function with given fields:

func (*MockPullerPlan) Step

func (_m *MockPullerPlan) Step(idx uint) Step

Step provides a mock function with given fields: idx

func (*MockPullerPlan) String

func (_m *MockPullerPlan) String() string

String provides a mock function with given fields:

func (*MockPullerPlan) Tables

func (_m *MockPullerPlan) Tables() TableList

Tables provides a mock function with given fields:

type MockRelation

type MockRelation struct {
	mock.Mock
}

MockRelation is an autogenerated mock type for the Relation type

func (*MockRelation) Child

func (_m *MockRelation) Child() Table

Child provides a mock function with given fields:

func (*MockRelation) Name

func (_m *MockRelation) Name() string

Name provides a mock function with given fields:

func (*MockRelation) Parent

func (_m *MockRelation) Parent() Table

Parent provides a mock function with given fields:

func (*MockRelation) String

func (_m *MockRelation) String() string

String provides a mock function with given fields:

type MockRelationList

type MockRelationList struct {
	mock.Mock
}

MockRelationList is an autogenerated mock type for the RelationList type

func (*MockRelationList) Contains

func (_m *MockRelationList) Contains(_a0 string) bool

Contains provides a mock function with given fields: _a0

func (*MockRelationList) Len

func (_m *MockRelationList) Len() uint

Len provides a mock function with given fields:

func (*MockRelationList) Relation

func (_m *MockRelationList) Relation(idx uint) Relation

Relation provides a mock function with given fields: idx

func (*MockRelationList) String

func (_m *MockRelationList) String() string

String provides a mock function with given fields:

type MockRelationReader

type MockRelationReader struct {
	mock.Mock
}

MockRelationReader is an autogenerated mock type for the RelationReader type

func (*MockRelationReader) Read

func (_m *MockRelationReader) Read() (RelationList, *Error)

Read provides a mock function with given fields:

type MockStep

type MockStep struct {
	mock.Mock
}

MockStep is an autogenerated mock type for the Step type

func (*MockStep) Cycles

func (_m *MockStep) Cycles() CycleList

Cycles provides a mock function with given fields:

func (*MockStep) Entry

func (_m *MockStep) Entry() Table

Entry provides a mock function with given fields:

func (*MockStep) Following

func (_m *MockStep) Following() IngressRelation

Following provides a mock function with given fields:

func (*MockStep) Index

func (_m *MockStep) Index() uint

Index provides a mock function with given fields:

func (*MockStep) PreviousStep

func (_m *MockStep) PreviousStep() uint

PreviousStep provides a mock function with given fields:

func (*MockStep) Relations

func (_m *MockStep) Relations() IngressRelationList

Relations provides a mock function with given fields:

func (*MockStep) String

func (_m *MockStep) String() string

String provides a mock function with given fields:

func (*MockStep) Tables

func (_m *MockStep) Tables() TableList

Tables provides a mock function with given fields:

type MockStorage

type MockStorage struct {
	mock.Mock
}

MockStorage is an autogenerated mock type for the Storage type

func (*MockStorage) Read

func (_m *MockStorage) Read() (IngressDescriptor, *Error)

Read provides a mock function with given fields:

func (*MockStorage) Store

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

Store provides a mock function with given fields: _a0

type MockTable

type MockTable struct {
	mock.Mock
}

MockTable is an autogenerated mock type for the Table type

func (*MockTable) Name

func (_m *MockTable) Name() string

Name provides a mock function with given fields:

func (*MockTable) String

func (_m *MockTable) String() string

String provides a mock function with given fields:

type MockTableList

type MockTableList struct {
	mock.Mock
}

MockTableList is an autogenerated mock type for the TableList type

func (*MockTableList) Contains

func (_m *MockTableList) Contains(_a0 string) bool

Contains provides a mock function with given fields: _a0

func (*MockTableList) Len

func (_m *MockTableList) Len() uint

Len provides a mock function with given fields:

func (*MockTableList) String

func (_m *MockTableList) String() string

String provides a mock function with given fields:

func (*MockTableList) Table

func (_m *MockTableList) Table(idx uint) Table

Table provides a mock function with given fields: idx

type PullerPlan

type PullerPlan interface {
	Len() uint
	Step(idx uint) Step
	Relations() IngressRelationList
	Tables() TableList
	String() string
}

PullerPlan is the computed plan that lists all steps required to pull data.

func NewPullerPlan

func NewPullerPlan(steps []Step, relations IngressRelationList, tables TableList) PullerPlan

NewPullerPlan initialize a new PullerPlan object

type Relation

type Relation interface {
	Name() string
	Parent() Table
	Child() Table
	String() string
}

Relation involved in an puller plan.

func NewRelation

func NewRelation(name string, parent Table, child Table) Relation

NewRelation initialize a new Relation object

type RelationList

type RelationList interface {
	Len() uint
	Relation(idx uint) Relation
	Contains(string) bool
	String() string
}

RelationList involved in an puller plan.

func NewRelationList

func NewRelationList(relations []Relation) RelationList

NewRelationList initialize a new RelationList object

type RelationReader

type RelationReader interface {
	Read() (RelationList, *Error)
}

RelationReader read relations from a source.

type Step

type Step interface {
	Index() uint
	Entry() Table
	Following() IngressRelation
	Relations() IngressRelationList
	Tables() TableList
	Cycles() CycleList
	PreviousStep() uint
	String() string
}

An Step gives required information to pull data.

func NewStep

func NewStep(index uint, entry Table, following IngressRelation, relations IngressRelationList, tables TableList, cycles CycleList, previousStep uint) Step

NewStep initialize a new Step object

type Storage

type Storage interface {
	Store(IngressDescriptor) *Error
	Read() (IngressDescriptor, *Error)
}

Storage allows to store and retrieve ingress descriptor objects.

type Table

type Table interface {
	Name() string
	String() string
}

Table involved in an puller plan.

func NewTable

func NewTable(name string) Table

NewTable initialize a new Table object

type TableList

type TableList interface {
	Len() uint
	Table(idx uint) Table
	Contains(string) bool
	String() string
}

TableList involved in an puller plan.

func NewTableList

func NewTableList(tables []Table) TableList

NewTableList initialize a new TableList object

Jump to

Keyboard shortcuts

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