sources

package
v0.0.0-...-8aeb8a1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusInstance = &Status{Reloading: false}

Functions

This section is empty.

Types

type Payload

type Payload struct {
	Sources map[string]driversbase.SourceConfig `json:"sources,omitempty"`
}

type Service

type Service struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Service keep up-to-date sources

func NewService

func NewService(ctx context.Context, sources *viper.Viper, sourcesURL string, destinationsService *destinations.Service, metaStorage meta.Storage,
	cronScheduler *scheduling.CronScheduler) (*Service, error)

NewService returns initialized Service instance or error if occurred

func NewTestService

func NewTestService() *Service

NewTestService is used only for tests

func (*Service) Close

func (s *Service) Close() (multiErr error)

func (*Service) GetCollections

func (s *Service) GetCollections(sourceID string) ([]string, error)

func (*Service) GetSource

func (s *Service) GetSource(sourceID string) (*Unit, error)

func (*Service) IsConfigured

func (s *Service) IsConfigured() bool

type Status

type Status struct {
	Reloading bool
}

Status is a singleton struct for storing sources reloading state. Scheduler checks this flag and doesn't run Sync tasks

type Unit

type Unit struct {
	SourceID                 string
	SourceType               string
	DriverPerCollection      map[string]driversbase.Driver
	DestinationIDs           []string
	PostHandleDestinationIDs []string
	Notifications            map[string]interface{}
	ProjectName              string
	// contains filtered or unexported fields
}

func (*Unit) Close

func (u *Unit) Close() (multiErr error)

Close all drivers

Jump to

Keyboard shortcuts

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