loaders

package
v1.0.0-dev Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RateIDsFromOrderedNavigableMap

func RateIDsFromOrderedNavigableMap(data *utils.OrderedNavigableMap) ([]string, error)

func TenantIDFromOrderedNavigableMap

func TenantIDFromOrderedNavigableMap(data *utils.OrderedNavigableMap) *utils.TenantID

Types

type ArgsProcessFolder

type ArgsProcessFolder struct {
	LoaderID string
	APIOpts  map[string]any
}

type ArgsProcessZip

type ArgsProcessZip struct {
	LoaderID string
	Data     []byte
	APIOpts  map[string]any
}

type CSVFile

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

func NewCSVFile

func NewCSVFile(rdr io.ReadCloser, path string, sep rune, nrFlds int) *CSVFile

func NewCSVReader

func NewCSVReader(prv CSVProvider, dPath, fn string, sep rune, nrFlds int) (_ *CSVFile, err error)

func NewStringCSV

func NewStringCSV(data string, sep rune, nrFlds int) *CSVFile

func (*CSVFile) Close

func (c *CSVFile) Close() error

func (*CSVFile) Path

func (c *CSVFile) Path() string

func (*CSVFile) Read

func (c *CSVFile) Read() ([]string, error)

type CSVProvider

type CSVProvider interface {
	Open(dPath, fn string) (io.ReadCloser, error)
	Type() string
}

type LoaderS

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

LoaderS is the Loader service handling independent Loaders

func NewLoaderS

func NewLoaderS(cfg *config.CGRConfig, dm *engine.DataManager,
	filterS *engine.FilterS,
	connMgr *engine.ConnManager) (ldrS *LoaderS)

func (*LoaderS) Enabled

func (ldrS *LoaderS) Enabled() bool

Enabled returns true if at least one loader is enabled

func (*LoaderS) ListenAndServe

func (ldrS *LoaderS) ListenAndServe(stopChan chan struct{}) (err error)

func (*LoaderS) Reload

func (ldrS *LoaderS) Reload(dm *engine.DataManager,
	filterS *engine.FilterS, connMgr *engine.ConnManager)

Reload recreates the loaders map thread safe

func (*LoaderS) V1ImportZip

func (ldrS *LoaderS) V1ImportZip(ctx *context.Context, args *ArgsProcessZip,
	rply *string) (err error)

func (*LoaderS) V1Run

func (ldrS *LoaderS) V1Run(ctx *context.Context, args *ArgsProcessFolder,
	rply *string) (err error)

type Locker

type Locker interface {
	Lock() error
	Unlock() error
	Locked() (bool, error)
	IsLockFile(string) bool
}

Jump to

Keyboard shortcuts

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