loaders

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgsProcessFolder

type ArgsProcessFolder struct {
	LoaderID  string
	ForceLock bool
	Caching   *string
}

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader is one instance loading from a folder

func NewLoader

func NewLoader(dm *engine.DataManager, cfg *config.LoaderSCfg,
	timezone string, exitChan chan bool, filterS *engine.FilterS,
	connMgr *engine.ConnManager, cacheConns []string) (ldr *Loader)

func (*Loader) ListenAndServe

func (ldr *Loader) ListenAndServe(exitChan chan struct{}) (err error)

func (*Loader) ProcessFolder

func (ldr *Loader) ProcessFolder(caching, loadOption string) (err error)

ProcessFolder will process the content in the folder with locking

type LoaderData

type LoaderData map[string]any

func (LoaderData) TenantID

func (ld LoaderData) TenantID() string

func (LoaderData) TenantIDStruct

func (ld LoaderData) TenantIDStruct() utils.TenantID

func (LoaderData) UpdateFromCSV

func (ld LoaderData) UpdateFromCSV(fileName string, record []string,
	cfgTpl []*config.FCTemplate, tnt config.RSRParsers, filterS *engine.FilterS) (err error)

UpdateFromCSV will update LoaderData with data received from fileName, contained in record and processed with cfgTpl

type LoaderService

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

LoaderS is the Loader service handling independent Loaders

func NewLoaderService

func NewLoaderService(dm *engine.DataManager, ldrsCfg []*config.LoaderSCfg,
	timezone string, exitChan chan bool, filterS *engine.FilterS,
	connMgr *engine.ConnManager) (ldrS *LoaderService)

func (*LoaderService) Enabled

func (ldrS *LoaderService) Enabled() bool

IsEnabled returns true if at least one loader is enabled

func (*LoaderService) ListenAndServe

func (ldrS *LoaderService) ListenAndServe(exitChan chan bool) (err error)

func (*LoaderService) Reload

func (ldrS *LoaderService) Reload(dm *engine.DataManager, ldrsCfg []*config.LoaderSCfg,
	timezone string, exitChan chan bool, filterS *engine.FilterS, connMgr *engine.ConnManager)

Reload recreates the loaders map thread safe

func (*LoaderService) V1Load

func (ldrS *LoaderService) V1Load(args *ArgsProcessFolder,
	rply *string) (err error)

func (*LoaderService) V1Remove

func (ldrS *LoaderService) V1Remove(args *ArgsProcessFolder,
	rply *string) (err error)

Jump to

Keyboard shortcuts

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