sources

package
v0.0.0-...-a06e19b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinedSource

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

func Combine

func Combine(srcs ...MockedSource) *CombinedSource

func (*CombinedSource) Duplicate

func (cs *CombinedSource) Duplicate() MockedSource

func (*CombinedSource) Flows

func (cs *CombinedSource) Flows() FlowsChannel

func (*CombinedSource) Namespaces

func (cs *CombinedSource) Namespaces() NSEventChannel

func (*CombinedSource) Run

func (cs *CombinedSource) Run(ctx context.Context)

func (*CombinedSource) Stop

func (cs *CombinedSource) Stop()

func (*CombinedSource) Stopped

func (es *CombinedSource) Stopped() chan struct{}

type FlowsChannel

type FlowsChannel chan *pbFlow.Flow

type LogFileSource

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

func (*LogFileSource) Duplicate

func (lfs *LogFileSource) Duplicate() MockedSource

func (*LogFileSource) Flows

func (lfs *LogFileSource) Flows() FlowsChannel

func (*LogFileSource) Namespaces

func (es *LogFileSource) Namespaces() NSEventChannel

func (*LogFileSource) Run

func (lfs *LogFileSource) Run(ctx context.Context)

func (*LogFileSource) Stop

func (es *LogFileSource) Stop()

func (*LogFileSource) Stopped

func (es *LogFileSource) Stopped() chan struct{}

type LogFileSourceOpts

type LogFileSourceOpts struct {
	FlowsRateLimit rate_limiter.RateLimit
	DebugHandler   func(int, *events_log_file.EventEntry)
}

type MockedSource

type MockedSource interface {
	Namespaces() NSEventChannel
	Flows() FlowsChannel

	Run(context.Context)
	Stop()
	Stopped() chan struct{}

	// NOTE: The thing is that we would like to use the same data from source
	// for multiple clients/streams, this method is attempt to simulate that
	// broadcast behavior
	Duplicate() MockedSource
}

type NSEventChannel

type NSEventChannel chan *ns_common.NSEvent

type NamespaceSource

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

func Namespaces

func Namespaces(initial []*ns_common.NSEvent) *NamespaceSource

func (*NamespaceSource) Duplicate

func (nss *NamespaceSource) Duplicate() MockedSource

func (*NamespaceSource) Flows

func (es *NamespaceSource) Flows() FlowsChannel

func (*NamespaceSource) Namespaces

func (nss *NamespaceSource) Namespaces() NSEventChannel

func (*NamespaceSource) Run

func (nss *NamespaceSource) Run(ctx context.Context)

func (*NamespaceSource) Stop

func (es *NamespaceSource) Stop()

func (*NamespaceSource) Stopped

func (es *NamespaceSource) Stopped() chan struct{}

Jump to

Keyboard shortcuts

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