collector

package
v0.0.0-...-0cfaaa3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCollectors

func NewCollectors(config *config.Config,
	newRecord func() interface{},
	key func(record interface{}) interface{},
	reducer func(key, source interface{}),
	mapper func(accumulator *Accumulator) interface{},
	loader loader2.Loader, metrics *gmetric.Service, count int) ([]*Service, []Collector, error)

Types

type Accumulator

type Accumulator struct {
	Map map[interface{}]interface{}
	sync.RWMutex
}

func NewAccumulator

func NewAccumulator() *Accumulator

func (*Accumulator) Get

func (a *Accumulator) Get(key interface{}) (interface{}, bool)

func (*Accumulator) Len

func (a *Accumulator) Len() int

func (*Accumulator) Put

func (a *Accumulator) Put(key, value interface{})

type Batch

type Batch struct {
	ID string
	*tconfig.Stream
	Accumulator *Accumulator
	Started     time.Time
	Count       int32

	PendingURL string
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBatch

func NewBatch(stream *tconfig.Stream, fs afs.Service, options ...Option) (*Batch, error)

func (Batch) IsActive

func (b Batch) IsActive(batch *config.Batch) bool

type Collector

type Collector interface {
	Collect(record interface{}) error
}

Collector represents a collector

type Option

type Option func(o *Options)

func WithInstanceId

func WithInstanceId(instanceId string) Option

func WithStreamURLSymLinkTrg

func WithStreamURLSymLinkTrg(streamURLSymLinkTrg string) Option

type Options

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

func NewOptions

func NewOptions(options ...Option) *Options

func (*Options) Apply

func (o *Options) Apply(opts ...Option)

func (*Options) GetInstanceId

func (o *Options) GetInstanceId() string

func (*Options) GetStreamURLSymLinkTrg

func (o *Options) GetStreamURLSymLinkTrg() string

type Service

type Service struct {
	*msg.Provider
	// contains filtered or unexported fields
}

func New

func New(config *config.Config,
	newRecord func() interface{},
	key func(record interface{}) interface{},
	reducer func(key, source interface{}),
	mapper func(accumulator *Accumulator) interface{},
	loader loader2.Loader, metrics *gmetric.Service, options ...Option) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) Collect

func (s *Service) Collect(record interface{}) error

func (*Service) FlushInBackground

func (s *Service) FlushInBackground(batch *Batch) error

func (*Service) NotifyWatcher

func (s *Service) NotifyWatcher()

func (*Service) RetryFailed

func (s *Service) RetryFailed(ctx context.Context, onStartUp bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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