Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNilTask is an error for nil task ErrNilTask = errors.New("nil task") // ErrParserTasksWasClosed is an error for closed tasks ErrParserTasksWasClosed = errors.New("tasks was closed") )
View Source
var ( // ErrSrcDataClosed is an error for closed src data ErrSrcDataClosed = errors.New("source of src data was closed") // ErrSrcDataIsNil is an error for nil src data ErrSrcDataIsNil = errors.New("src data is nil") )
View Source
var ErrSaverTasksWasClosed = errors.New("tasks was closed")
ErrSaverTasksWasClosed is an error for closed tasks
Functions ¶
This section is empty.
Types ¶
type DataParser ¶
type DataParser[TSrcData any, TPreSaverData any] interface { Parse(ctx context.Context, data *TSrcData) (*TPreSaverData, error) }
DataParser is a type for data parsers
type DataSource ¶
type DataSource[TSrcData any] interface { SrcData() <-chan *TSrcData Close() }
DataSource is a type for data sources
type MHandler ¶
type MHandler[TCheckPoint any, TSrcData any, TPreSaverData any, TSaverData any] struct { // contains filtered or unexported fields }
MHandler is a type for metrics handler
func NewMHandler ¶
func NewMHandler[TCheckPoint any, TSrcData any, TPreSaverData any, TSaverData any](ctx context.Context, stor Storage[TCheckPoint, TSaverData], createSrc func(ctx context.Context, startFromChp *TCheckPoint) (DataSource[TSrcData], error), parser DataParser[TSrcData, TPreSaverData], createPreSaver func(ctx context.Context) (PreSaver[TCheckPoint, TPreSaverData, TSaverData], error), parserPoolCountWorkers, saverTasksBufSize, saverMaxBatchSize uint, ) *MHandler[TCheckPoint, TSrcData, TPreSaverData, TSaverData]
NewMHandler creates a new metrics handler
Click to show internal directories.
Click to hide internal directories.