decoder

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: BSD-3-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecoderFunc

type DecoderFunc func(Message interface{}) error

type DecoderParams

type DecoderParams struct {
	DecoderFunc   DecoderFunc
	DoneCallback  DoneCallback
	ErrorCallback ErrorCallback
}

Decoder structure. Define the function to call and the config specific to the type of packets.

type DoneCallback

type DoneCallback func(string, int, time.Time, time.Time)

type ErrorCallback

type ErrorCallback func(string, int, time.Time, time.Time, error)

type Message

type Message interface{}

type MessageDecoded

type MessageDecoded interface{}

type Processor

type Processor struct {
	DecoderParams DecoderParams
	Name          string
	// contains filtered or unexported fields
}

Processor structure

func CreateProcessor

func CreateProcessor(numWorkers int, decoderParams DecoderParams, name string) Processor

Create a message processor which is going to create all the workers and set-up the pool.

func (Processor) ProcessMessage

func (p Processor) ProcessMessage(msg Message)

Send a message to be decoded to the pool.

func (Processor) Start

func (p Processor) Start()

Start message processor

func (Processor) Stop

func (p Processor) Stop()

type Worker

type Worker struct {
	Id            int
	DecoderParams DecoderParams
	WorkerPool    chan chan Message
	Name          string
	InMsg         chan Message
	Quit          chan bool
}

Worker structure

func CreateWorker

func CreateWorker(workerPool chan chan Message, decoderParams DecoderParams, id int, name string) Worker

Create a worker and add it to the pool.

func (Worker) Start

func (w Worker) Start()

Start the worker. Launches a goroutine to process NFv9 messages. The worker will add its input channel of NFv9 messages to decode to the pool.

func (Worker) Stop

func (w Worker) Stop()

Stop the worker.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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