importers

package
v2.19.7 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseImporter

type BaseImporter struct {
	exchangers.BaseExchanger
	// contains filtered or unexported fields
}

BaseImporter implements basic importer functionality common to all importers.

func (*BaseImporter) Process

func (importer *BaseImporter) Process(connectors *connectors.Collection) (bool, error)

Process is called periodically to perform the actual import; if data has been imported, true is returned.

type BaseRequestImporter

type BaseRequestImporter struct {
	BaseImporter
	exchangers.BaseRequestExchanger
}

BaseRequestImporter implements basic importer functionality common to all request importers.

func (*BaseRequestImporter) HandleRequest

func (importer *BaseRequestImporter) HandleRequest(resp http.ResponseWriter, req *http.Request, conf *config.Configuration, log *zerolog.Logger)

HandleRequest handles the actual HTTP request.

type Collection

type Collection struct {
	Importers []Importer
}

Collection represents a collection of importers.

func AvailableImporters

func AvailableImporters(conf *config.Configuration) (*Collection, error)

AvailableImporters returns a collection of all importers that are enabled in the configuration.

func (*Collection) ActivateAll

func (collection *Collection) ActivateAll(conf *config.Configuration, log *zerolog.Logger) error

ActivateAll activates all importers.

func (*Collection) Entities

func (collection *Collection) Entities() []entity.Entity

Entities returns a vector of entities within the collection.

func (*Collection) Exchangers

func (collection *Collection) Exchangers() []exchangers.Exchanger

Exchangers returns a vector of exchangers within the collection.

func (*Collection) GetRequestImporters

func (collection *Collection) GetRequestImporters() []exchangers.RequestExchanger

GetRequestImporters returns all importers that implement the RequestExchanger interface.

func (*Collection) StartAll

func (collection *Collection) StartAll() error

StartAll starts all importers.

func (*Collection) StopAll

func (collection *Collection) StopAll()

StopAll stops all importers.

type Importer

type Importer interface {
	exchangers.Exchanger

	// Process is called periodically to perform the actual import; if data has been imported, true is returned.
	Process(*connectors.Collection) (bool, error)
}

Importer is the interface that all importers must implement.

Jump to

Keyboard shortcuts

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