core

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: GPL-3.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigEngine

type ConfigEngine struct {
	BusMap         map[string]string      `json:"bus_map"`
	Rules          map[string]*RuleOption `json:"rules"`
	TimeoutSession int                    `json:"timeout_session"`
	Log            ConfigLog              `json:"log"`
	Plugins        []string               `json:"plugins"`
}

type ConfigLog

type ConfigLog struct {
	Level         string `json:"level"`
	Output        string `json:"output"`
	FileName      string `json:"file_name"`
	LogMethodName bool   `json:"log_method_name"`
}

type DipperEngine

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

func NewDipperEngine

func NewDipperEngine(
	config *ConfigEngine,
	factoryQueue FactoryQueue[*data.InputEngine],
	factoryQueueOutput FactoryQueueName[*data.OutputEngine],
	store store.Store,
	bus bus2.Bus,
) *DipperEngine

func (*DipperEngine) Add

func (d *DipperEngine) Add(ctx context.Context, sessionData *data.Session) error

func (*DipperEngine) AddRule

func (d *DipperEngine) AddRule(rules ...Rule)

func (*DipperEngine) LoadPlugin

func (d *DipperEngine) LoadPlugin()

func (*DipperEngine) RuleEnable

func (d *DipperEngine) RuleEnable() []string

func (*DipperEngine) SessionInputQueue

func (d *DipperEngine) SessionInputQueue(factoryQueueName FactoryQueueName[*data.Session])

func (*DipperEngine) SessionOutputQueue

func (d *DipperEngine) SessionOutputQueue(factoryQueueOutputName FactoryQueueName[*data.ResultSession])

func (*DipperEngine) SetConfig

func (d *DipperEngine) SetConfig(conf *ConfigEngine)

func (*DipperEngine) SetContext

func (d *DipperEngine) SetContext(ctx context.Context)

func (*DipperEngine) Start

func (d *DipperEngine) Start() error

func (*DipperEngine) Stop

func (d *DipperEngine) Stop() error

type FactoryQueue

type FactoryQueue[T any] func(engine Rule) queue.QueueEngine[T]

func FactoryQueueDefault

func FactoryQueueDefault[T any]() FactoryQueue[T]

type FactoryQueueName

type FactoryQueueName[T any] func(name string) queue.QueueEngine[T]

func FactoryQueueNameDefault

func FactoryQueueNameDefault[T any]() FactoryQueueName[T]

type PluginDipper

type PluginDipper interface {
	Rules() []Rule
}

type Rule

type Rule interface {
	Id() string
	Initialize(ctx context.Context, option map[string]interface{}) error
	Run(ctx context.Context,
		subscribeQueueInput func(ctx context.Context, callback queue.SubscribeFunction[*data.InputEngine]) error,
		pushQueueOutput func(ctx context.Context, input *data.OutputEngine) error)
	Stop(ctx context.Context) error
}

type RuleOption

type RuleOption struct {
	Enable  bool                   `json:"enable"`
	Worker  int                    `json:"worker"`
	Options map[string]interface{} `json:"options"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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