ees

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportWithAttempts

func ExportWithAttempts(ctx *context.Context, exp EventExporter, eEv any, key any,
	connMngr *engine.ConnManager, tnt string) (err error)

func GetNatsOpts

func GetNatsOpts(opts *config.EventExporterOpts, nodeID string, connTimeout time.Duration) ([]nats.Option, error)

Types

type AMQPee

type AMQPee struct {
	sync.RWMutex // protect connection
	// contains filtered or unexported fields
}

AMQPee used to post cdrs to amqp

func NewAMQPee

func NewAMQPee(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) *AMQPee

NewAMQPee creates a new amqp poster "amqp://guest:guest@localhost:5672/?queueID=cgrates_cdrs"

func (*AMQPee) Cfg

func (pstr *AMQPee) Cfg() *config.EventExporterCfg

func (*AMQPee) Close

func (pstr *AMQPee) Close() (err error)

func (*AMQPee) Connect

func (pstr *AMQPee) Connect() (err error)

func (*AMQPee) ExportEvent

func (pstr *AMQPee) ExportEvent(_ *context.Context, content, _ any) (err error)

func (*AMQPee) ExtraData

func (pstr *AMQPee) ExtraData(*utils.CGREvent) any

func (*AMQPee) GetMetrics

func (pstr *AMQPee) GetMetrics() *utils.SafeMapStorage

func (AMQPee) PrepareMap

func (AMQPee) PrepareMap(mp *utils.CGREvent) (any, error)

func (AMQPee) PrepareOrderMap

func (AMQPee) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type AMQPv1EE

type AMQPv1EE struct {
	sync.RWMutex // protect connection
	// contains filtered or unexported fields
}

AMQPv1EE a poster for amqpv1

func NewAMQPv1EE

func NewAMQPv1EE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) *AMQPv1EE

NewAMQPv1EE creates a poster for amqpv1

func (*AMQPv1EE) Cfg

func (pstr *AMQPv1EE) Cfg() *config.EventExporterCfg

func (*AMQPv1EE) Close

func (pstr *AMQPv1EE) Close() (err error)

func (*AMQPv1EE) Connect

func (pstr *AMQPv1EE) Connect() (err error)

func (*AMQPv1EE) ExportEvent

func (pstr *AMQPv1EE) ExportEvent(ctx *context.Context, content, _ any) (err error)

func (*AMQPv1EE) ExtraData

func (pstr *AMQPv1EE) ExtraData(*utils.CGREvent) any

func (*AMQPv1EE) GetMetrics

func (pstr *AMQPv1EE) GetMetrics() *utils.SafeMapStorage

func (AMQPv1EE) PrepareMap

func (AMQPv1EE) PrepareMap(mp *utils.CGREvent) (any, error)

func (AMQPv1EE) PrepareOrderMap

func (AMQPv1EE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type ArchiveEventsArgs

type ArchiveEventsArgs struct {
	Tenant  string
	APIOpts map[string]any
	Events  []*utils.EventsWithOpts
}

type EeS

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

EeS is managing the EventExporters

func NewEventExporterS

func NewEventExporterS(cfg *config.CGRConfig, fltrS *engine.FilterS,
	connMgr *engine.ConnManager) (*EeS, error)

NewEventExporterS initializes a new EventExporterS.

func (*EeS) ClearExporterCache

func (eeS *EeS) ClearExporterCache()

ClearExporterCache clears the cache of EventExporters.

func (*EeS) SetupExporterCache

func (eeS *EeS) SetupExporterCache() error

SetupExporterCache initializes the cache for EventExporters.

func (*EeS) V1ArchiveEventsInReply

func (eeS *EeS) V1ArchiveEventsInReply(ctx *context.Context, args *ArchiveEventsArgs, reply *[]byte) (err error)

V1ArchiveEventsInReply should archive the events sent with existing exporters. The zipped content should be returned back as a reply.

func (*EeS) V1ProcessEvent

func (eeS *EeS) V1ProcessEvent(ctx *context.Context, cgrEv *utils.CGREventWithEeIDs, rply *map[string]map[string]any) (err error)

type ElasticEE

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

ElasticEE implements EventExporter interface for ElasticSearch export.

func NewElasticEE

func NewElasticEE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) (*ElasticEE, error)

func (*ElasticEE) Cfg

func (e *ElasticEE) Cfg() *config.EventExporterCfg

func (*ElasticEE) Close

func (e *ElasticEE) Close() error

func (*ElasticEE) Connect

func (e *ElasticEE) Connect() (err error)

func (*ElasticEE) ExportEvent

func (e *ElasticEE) ExportEvent(ctx *context.Context, event, extraData any) error

ExportEvent implements EventExporter

func (*ElasticEE) ExtraData

func (eEE *ElasticEE) ExtraData(ev *utils.CGREvent) any

func (*ElasticEE) GetMetrics

func (e *ElasticEE) GetMetrics() *utils.SafeMapStorage

func (*ElasticEE) PrepareMap

func (e *ElasticEE) PrepareMap(cgrEv *utils.CGREvent) (any, error)

func (*ElasticEE) PrepareOrderMap

func (e *ElasticEE) PrepareOrderMap(onm *utils.OrderedNavigableMap) (any, error)

type EventExporter

type EventExporter interface {
	Cfg() *config.EventExporterCfg                                      // return the config
	Connect() error                                                     // called before exporting an event to make sure it is connected
	ExportEvent(ctx *context.Context, content any, extraData any) error // called on each event to be exported
	Close() error                                                       // called when the exporter needs to terminate
	GetMetrics() *utils.SafeMapStorage                                  // called to get metrics
	PrepareMap(*utils.CGREvent) (any, error)
	PrepareOrderMap(*utils.OrderedNavigableMap) (any, error)
	ExtraData(*utils.CGREvent) any
}

func NewEventExporter

func NewEventExporter(cfg *config.EventExporterCfg, cgrCfg *config.CGRConfig,
	filterS *engine.FilterS, connMngr *engine.ConnManager) (ee EventExporter, err error)

NewEventExporter produces exporters

type ExportRequest

type ExportRequest struct {
	ExpData map[string]*utils.OrderedNavigableMap // *exp:OrderNavMp *trl:OrderNavMp *cdr:OrderNavMp
	// contains filtered or unexported fields
}

ExportRequest represents data related to one request towards agent implements utils.DataProvider so we can pass it to filters

func NewExportRequest

func NewExportRequest(inData map[string]utils.DataStorage,
	tnt string,
	filterS *engine.FilterS, oNM map[string]*utils.OrderedNavigableMap) (eeR *ExportRequest)

NewExportRequest returns a new EventRequest

func (*ExportRequest) Append

func (eeR *ExportRequest) Append(fullPath *utils.FullPath, val *utils.DataLeaf) (err error)

Set sets the value at the given path this used with full path and the processed path to not calculate them for every set

func (*ExportRequest) Compose

func (eeR *ExportRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf) (err error)

Set sets the value at the given path this used with full path and the processed path to not calculate them for every set

func (*ExportRequest) FieldAsInterface

func (eeR *ExportRequest) FieldAsInterface(fldPath []string) (val any, err error)

FieldAsInterface implements utils.DataProvider

func (*ExportRequest) FieldAsString

func (eeR *ExportRequest) FieldAsString(fldPath []string) (val string, err error)

FieldAsString implements utils.DataProvider

func (*ExportRequest) ParseField

func (eeR *ExportRequest) ParseField(
	cfgFld *config.FCTemplate) (out any, err error)

ParseField outputs the value based on the template item

func (*ExportRequest) SetAsSlice

func (eeR *ExportRequest) SetAsSlice(fullPath *utils.FullPath, val *utils.DataLeaf) (err error)

Set implements utils.NMInterface

func (*ExportRequest) SetFields

func (eeR *ExportRequest) SetFields(ctx *context.Context, tplFlds []*config.FCTemplate) (err error)

SetFields will populate fields of AgentRequest out of templates

func (*ExportRequest) String

func (eeR *ExportRequest) String() string

String implements utils.DataProvider

type FileCSVee

type FileCSVee struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FileCSVee implements EventExporter interface for .csv files

func NewFileCSVee

func NewFileCSVee(cfg *config.EventExporterCfg,
	cgrCfg *config.CGRConfig, filterS *engine.FilterS,
	dc *utils.SafeMapStorage, wrtr io.WriteCloser) (fCsv *FileCSVee, err error)

func (*FileCSVee) Cfg

func (fCsv *FileCSVee) Cfg() *config.EventExporterCfg

func (*FileCSVee) Close

func (fCsv *FileCSVee) Close() (err error)

func (*FileCSVee) Connect

func (fCsv *FileCSVee) Connect() (_ error)

func (*FileCSVee) ExportEvent

func (fCsv *FileCSVee) ExportEvent(_ *context.Context, ev, _ any) error

func (*FileCSVee) ExtraData

func (fCsv *FileCSVee) ExtraData(ev *utils.CGREvent) any

func (*FileCSVee) GetMetrics

func (fCsv *FileCSVee) GetMetrics() *utils.SafeMapStorage

func (FileCSVee) PrepareMap

func (FileCSVee) PrepareMap(mp *utils.CGREvent) (any, error)

func (FileCSVee) PrepareOrderMap

func (FileCSVee) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type FileFWVee

type FileFWVee struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FileFWVee implements EventExporter interface for .fwv files

func NewFileFWVee

func NewFileFWVee(cfg *config.EventExporterCfg, cgrCfg *config.CGRConfig, filterS *engine.FilterS, dc *utils.SafeMapStorage, writer io.Writer) (fFwv *FileFWVee, err error)

func (*FileFWVee) Cfg

func (fFwv *FileFWVee) Cfg() *config.EventExporterCfg

func (*FileFWVee) Close

func (fFwv *FileFWVee) Close() (err error)

func (*FileFWVee) Connect

func (fFwv *FileFWVee) Connect() (_ error)

func (*FileFWVee) ExportEvent

func (fFwv *FileFWVee) ExportEvent(_ *context.Context, records, _ any) (err error)

func (*FileFWVee) ExtraData

func (fFwv *FileFWVee) ExtraData(ev *utils.CGREvent) any

func (*FileFWVee) GetMetrics

func (fFwv *FileFWVee) GetMetrics() *utils.SafeMapStorage

func (FileFWVee) PrepareMap

func (FileFWVee) PrepareMap(mp *utils.CGREvent) (any, error)

func (FileFWVee) PrepareOrderMap

func (FileFWVee) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type HTTPPostEE

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

FileCSVee implements EventExporter interface for .csv files

func NewHTTPPostEE

func NewHTTPPostEE(cfg *config.EventExporterCfg, cgrCfg *config.CGRConfig, filterS *engine.FilterS,
	dc *utils.SafeMapStorage) (httpPost *HTTPPostEE, err error)

func (*HTTPPostEE) Cfg

func (httpPost *HTTPPostEE) Cfg() *config.EventExporterCfg

func (*HTTPPostEE) Close

func (httpPost *HTTPPostEE) Close() (_ error)

func (*HTTPPostEE) Connect

func (httpPost *HTTPPostEE) Connect() (_ error)

func (*HTTPPostEE) ExportEvent

func (httpPost *HTTPPostEE) ExportEvent(ctx *context.Context, content, _ any) (err error)

func (*HTTPPostEE) ExtraData

func (httpPost *HTTPPostEE) ExtraData(ev *utils.CGREvent) any

func (*HTTPPostEE) GetMetrics

func (httpPost *HTTPPostEE) GetMetrics() *utils.SafeMapStorage

func (*HTTPPostEE) PrepareMap

func (httpPost *HTTPPostEE) PrepareMap(mp *utils.CGREvent) (any, error)

func (*HTTPPostEE) PrepareOrderMap

func (httpPost *HTTPPostEE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type HTTPPosterRequest

type HTTPPosterRequest struct {
	Header http.Header
	Body   any
}

type HTTPjsonMapEE

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

HTTPjsonMapEE implements EventExporter interface for .csv files

func NewHTTPjsonMapEE

func NewHTTPjsonMapEE(cfg *config.EventExporterCfg, cgrCfg *config.CGRConfig, filterS *engine.FilterS,
	dc *utils.SafeMapStorage) (pstrJSON *HTTPjsonMapEE, err error)

func (*HTTPjsonMapEE) Cfg

func (httpEE *HTTPjsonMapEE) Cfg() *config.EventExporterCfg

func (*HTTPjsonMapEE) Close

func (httpEE *HTTPjsonMapEE) Close() (_ error)

func (*HTTPjsonMapEE) Connect

func (httpEE *HTTPjsonMapEE) Connect() (_ error)

func (*HTTPjsonMapEE) ExportEvent

func (httpEE *HTTPjsonMapEE) ExportEvent(ctx *context.Context, content, _ any) (err error)

func (*HTTPjsonMapEE) ExtraData

func (httpEE *HTTPjsonMapEE) ExtraData(ev *utils.CGREvent) any

func (*HTTPjsonMapEE) GetMetrics

func (httpEE *HTTPjsonMapEE) GetMetrics() *utils.SafeMapStorage

func (*HTTPjsonMapEE) PrepareMap

func (httpEE *HTTPjsonMapEE) PrepareMap(mp *utils.CGREvent) (any, error)

func (*HTTPjsonMapEE) PrepareOrderMap

func (httpEE *HTTPjsonMapEE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type KafkaEE

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

KafkaEE is a kafka poster

func NewKafkaEE

func NewKafkaEE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) (*KafkaEE, error)

NewKafkaEE creates a kafka poster

func (*KafkaEE) Cfg

func (k *KafkaEE) Cfg() *config.EventExporterCfg

func (*KafkaEE) Close

func (k *KafkaEE) Close() error

func (*KafkaEE) Connect

func (k *KafkaEE) Connect() error

func (*KafkaEE) ExportEvent

func (k *KafkaEE) ExportEvent(_ *context.Context, content any, key any) error

func (*KafkaEE) ExtraData

func (k *KafkaEE) ExtraData(ev *utils.CGREvent) any

func (*KafkaEE) GetMetrics

func (k *KafkaEE) GetMetrics() *utils.SafeMapStorage

func (KafkaEE) PrepareMap

func (KafkaEE) PrepareMap(mp *utils.CGREvent) (any, error)

func (KafkaEE) PrepareOrderMap

func (KafkaEE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type LogEE

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

LogEE implements EventExporter interface for .csv files

func NewLogEE

func NewLogEE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) *LogEE

func (*LogEE) Cfg

func (vEe *LogEE) Cfg() *config.EventExporterCfg

func (*LogEE) Close

func (vEe *LogEE) Close() error

func (*LogEE) Connect

func (vEe *LogEE) Connect() error

func (*LogEE) ExportEvent

func (vEe *LogEE) ExportEvent(_ *context.Context, mp, _ any) error

func (*LogEE) ExtraData

func (vEe *LogEE) ExtraData(ev *utils.CGREvent) any

func (*LogEE) GetMetrics

func (vEe *LogEE) GetMetrics() *utils.SafeMapStorage

func (*LogEE) PrepareMap

func (vEe *LogEE) PrepareMap(mp *utils.CGREvent) (any, error)

func (*LogEE) PrepareOrderMap

func (vEe *LogEE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type NatsEE

type NatsEE struct {
	sync.RWMutex // protect writer
	// contains filtered or unexported fields
}

NatsEE is a kafka poster

func NewNatsEE

func NewNatsEE(cfg *config.EventExporterCfg, nodeID string, connTimeout time.Duration, dc *utils.SafeMapStorage) (natsPstr *NatsEE, err error)

NewNatsEE creates a kafka poster

func (*NatsEE) Cfg

func (pstr *NatsEE) Cfg() *config.EventExporterCfg

func (*NatsEE) Close

func (pstr *NatsEE) Close() error

func (*NatsEE) Connect

func (pstr *NatsEE) Connect() error

func (*NatsEE) ExportEvent

func (pstr *NatsEE) ExportEvent(ctx *context.Context, content, _ any) error

func (*NatsEE) ExtraData

func (pstr *NatsEE) ExtraData(ev *utils.CGREvent) any

func (*NatsEE) GetMetrics

func (pstr *NatsEE) GetMetrics() *utils.SafeMapStorage

func (NatsEE) PrepareMap

func (NatsEE) PrepareMap(mp *utils.CGREvent) (any, error)

func (NatsEE) PrepareOrderMap

func (NatsEE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type RPCee

type RPCee struct {
	sync.RWMutex // protect connection
	// contains filtered or unexported fields
}

func NewRpcEE

func NewRpcEE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage,
	connMgr *engine.ConnManager) (e *RPCee, err error)

func (*RPCee) Cfg

func (e *RPCee) Cfg() (eCfg *config.EventExporterCfg)

func (*RPCee) Close

func (e *RPCee) Close() (err error)

func (*RPCee) Connect

func (e *RPCee) Connect() (err error)

func (*RPCee) ExportEvent

func (e *RPCee) ExportEvent(ctx *context.Context, args, _ any) (err error)

func (*RPCee) ExtraData

func (e *RPCee) ExtraData(ev *utils.CGREvent) any

func (*RPCee) GetMetrics

func (e *RPCee) GetMetrics() (mp *utils.SafeMapStorage)

func (*RPCee) PrepareMap

func (e *RPCee) PrepareMap(mp *utils.CGREvent) (any, error)

func (*RPCee) PrepareOrderMap

func (e *RPCee) PrepareOrderMap(oMp *utils.OrderedNavigableMap) (any, error)

type S3EE

type S3EE struct {
	sync.RWMutex // protect connection
	// contains filtered or unexported fields
}

S3EE is a s3 poster

func NewS3EE

func NewS3EE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) *S3EE

NewS3EE creates a s3 poster

func (*S3EE) Cfg

func (pstr *S3EE) Cfg() *config.EventExporterCfg

func (*S3EE) Close

func (pstr *S3EE) Close() (_ error)

func (*S3EE) Connect

func (pstr *S3EE) Connect() (err error)

func (*S3EE) ExportEvent

func (pstr *S3EE) ExportEvent(ctx *context.Context, message, extraData any) (err error)

func (*S3EE) ExtraData

func (pstr *S3EE) ExtraData(ev *utils.CGREvent) any

func (*S3EE) GetMetrics

func (pstr *S3EE) GetMetrics() *utils.SafeMapStorage

func (S3EE) PrepareMap

func (S3EE) PrepareMap(mp *utils.CGREvent) (any, error)

func (S3EE) PrepareOrderMap

func (S3EE) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type SQLEe

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

SQLEe implements EventExporter interface for SQL

func NewSQLEe

func NewSQLEe(cfg *config.EventExporterCfg,
	dc *utils.SafeMapStorage) (sqlEe *SQLEe, err error)

func (*SQLEe) Cfg

func (sqlEe *SQLEe) Cfg() *config.EventExporterCfg

func (*SQLEe) Close

func (sqlEe *SQLEe) Close() (err error)

func (*SQLEe) Connect

func (sqlEe *SQLEe) Connect() (err error)

func (*SQLEe) ExportEvent

func (sqlEe *SQLEe) ExportEvent(_ *context.Context, req, _ any) error

func (*SQLEe) ExtraData

func (sqlEe *SQLEe) ExtraData(ev *utils.CGREvent) any

func (*SQLEe) GetMetrics

func (sqlEe *SQLEe) GetMetrics() *utils.SafeMapStorage

func (*SQLEe) PrepareMap

func (sqlEe *SQLEe) PrepareMap(mp *utils.CGREvent) (any, error)

func (*SQLEe) PrepareOrderMap

func (sqlEe *SQLEe) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type SQSee

type SQSee struct {
	sync.RWMutex // protect connection
	// contains filtered or unexported fields
}

SQSee is a poster for sqs

func NewSQSee

func NewSQSee(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) *SQSee

NewSQSee creates a poster for sqs

func (*SQSee) Cfg

func (pstr *SQSee) Cfg() *config.EventExporterCfg

func (*SQSee) Close

func (pstr *SQSee) Close() (_ error)

func (*SQSee) Connect

func (pstr *SQSee) Connect() (err error)

func (*SQSee) ExportEvent

func (pstr *SQSee) ExportEvent(ctx *context.Context, message, _ any) (err error)

func (*SQSee) ExtraData

func (pstr *SQSee) ExtraData(ev *utils.CGREvent) any

func (*SQSee) GetMetrics

func (pstr *SQSee) GetMetrics() *utils.SafeMapStorage

func (SQSee) PrepareMap

func (SQSee) PrepareMap(mp *utils.CGREvent) (any, error)

func (SQSee) PrepareOrderMap

func (SQSee) PrepareOrderMap(mp *utils.OrderedNavigableMap) (any, error)

type VirtualEE

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

VirtualEE implements EventExporter interface for .csv files

func NewVirtualEE

func NewVirtualEE(cfg *config.EventExporterCfg, dc *utils.SafeMapStorage) *VirtualEE

func (*VirtualEE) Cfg

func (vEe *VirtualEE) Cfg() *config.EventExporterCfg

func (*VirtualEE) Close

func (vEe *VirtualEE) Close() error

func (*VirtualEE) Connect

func (vEe *VirtualEE) Connect() error

func (*VirtualEE) ExportEvent

func (vEe *VirtualEE) ExportEvent(*context.Context, any, any) error

func (*VirtualEE) ExtraData

func (vEe *VirtualEE) ExtraData(*utils.CGREvent) any

func (*VirtualEE) GetMetrics

func (vEe *VirtualEE) GetMetrics() *utils.SafeMapStorage

func (*VirtualEE) PrepareMap

func (vEe *VirtualEE) PrepareMap(mp *utils.CGREvent) (any, error)

func (*VirtualEE) PrepareOrderMap

func (vEe *VirtualEE) PrepareOrderMap(*utils.OrderedNavigableMap) (any, error)

Jump to

Keyboard shortcuts

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