manager

package
v0.0.0-...-511da98 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type      string
	Tag       *TagInfo               `json:",omitempty"`
	Converter *converters.Statistics `json:",omitempty"`
	PcapStats *PcapStatistics        `json:",omitempty"`
}

type Manager

type Manager struct {
	StateDir     string
	PcapDir      string
	IndexDir     string
	SnapshotDir  string
	ConverterDir string
	// contains filtered or unexported fields
}

func New

func New(pcapDir, indexDir, snapshotDir, stateDir, converterDir string) (*Manager, error)

func (*Manager) AddPcapOverIPEndpoint

func (mgr *Manager) AddPcapOverIPEndpoint(address string) error

func (*Manager) AddPcapProcessorWebhook

func (mgr *Manager) AddPcapProcessorWebhook(url string) error

func (*Manager) AddTag

func (mgr *Manager) AddTag(name, color, queryString string) error

func (*Manager) Close

func (mgr *Manager) Close()

func (*Manager) ConverterStderr

func (mgr *Manager) ConverterStderr(converterName string, pid int) (*converters.ProcessStderr, error)

func (*Manager) DelPcapOverIPEndpoint

func (mgr *Manager) DelPcapOverIPEndpoint(address string) error

func (*Manager) DelPcapProcessorWebhook

func (mgr *Manager) DelPcapProcessorWebhook(url string) error

func (*Manager) DelTag

func (mgr *Manager) DelTag(name string) error

func (*Manager) GetView

func (mgr *Manager) GetView() View

func (*Manager) ImportPcaps

func (mgr *Manager) ImportPcaps(filenames []string)

func (*Manager) KnownPcaps

func (mgr *Manager) KnownPcaps() []pcapmetadata.PcapInfo

func (*Manager) ListConverters

func (mgr *Manager) ListConverters() []*converters.Statistics

func (*Manager) ListPcapOverIPEndpoints

func (mgr *Manager) ListPcapOverIPEndpoints() []PcapOverIPEndpointInfo

func (*Manager) ListPcapProcessorWebhooks

func (mgr *Manager) ListPcapProcessorWebhooks() []string

func (*Manager) ListTags

func (mgr *Manager) ListTags() []TagInfo

func (*Manager) Listen

func (mgr *Manager) Listen() (chan Event, func())

func (*Manager) ResetConverter

func (mgr *Manager) ResetConverter(converterName string) error

func (*Manager) Status

func (mgr *Manager) Status() Statistics

func (*Manager) UpdateTag

func (mgr *Manager) UpdateTag(name string, operation UpdateTagOperation) error

type PcapOverIPEndpointInfo

type PcapOverIPEndpointInfo struct {
	Address          string
	LastConnected    int64
	LastDisconnected int64
	ReceivedPackets  uint
}

type PcapStatistics

type PcapStatistics struct {
	PcapCount         int
	PacketCount       int
	ImportJobCount    int
	IndexCount        int
	StreamCount       int
	StreamRecordCount int
	PacketRecordCount int
}

type Statistics

type Statistics struct {
	ImportJobCount      int
	IndexCount          int
	IndexLockCount      uint
	PcapCount           int
	StreamCount         int
	PacketCount         int
	StreamRecordCount   int
	PacketRecordCount   int
	MergeJobRunning     bool
	TaggingJobRunning   bool
	ConverterJobRunning bool
}

type StreamContext

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

func (StreamContext) AllConverters

func (c StreamContext) AllConverters() ([]string, error)

func (StreamContext) AllTags

func (c StreamContext) AllTags() ([]string, error)

func (StreamContext) Data

func (c StreamContext) Data(converterName string) ([]index.Data, error)

func (StreamContext) HasTag

func (c StreamContext) HasTag(name string) (bool, error)

func (StreamContext) Stream

func (c StreamContext) Stream() *index.Stream

type StreamsOption

type StreamsOption func(*streamsOptions)

func Limit

func Limit(defaultLimit, page uint) StreamsOption

func PrefetchAllTags

func PrefetchAllTags() StreamsOption

func PrefetchTags

func PrefetchTags(tags []string) StreamsOption

type TagInfo

type TagInfo struct {
	Name           string
	Definition     string
	Color          string
	MatchingCount  uint
	UncertainCount uint
	Referenced     bool
	Converters     []string
}

type UpdateTagOperation

type UpdateTagOperation func(*updateTagOperationInfo)

func UpdateTagOperationMarkAddStream

func UpdateTagOperationMarkAddStream(streams []uint64) UpdateTagOperation

func UpdateTagOperationMarkDelStream

func UpdateTagOperationMarkDelStream(streams []uint64) UpdateTagOperation

func UpdateTagOperationSetConverter

func UpdateTagOperationSetConverter(converterNames []string) UpdateTagOperation

func UpdateTagOperationUpdateColor

func UpdateTagOperationUpdateColor(color string) UpdateTagOperation

func UpdateTagOperationUpdateName

func UpdateTagOperationUpdateName(name string) UpdateTagOperation

func UpdateTagOperationUpdateQuery

func UpdateTagOperationUpdateQuery(query string) UpdateTagOperation

type View

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

func (*View) AllStreams

func (v *View) AllStreams(ctx context.Context, f func(StreamContext) error, options ...StreamsOption) error

func (*View) ReferenceTime

func (v *View) ReferenceTime() (time.Time, error)

func (*View) Release

func (v *View) Release()

func (*View) SearchStreams

func (v *View) SearchStreams(ctx context.Context, filter *query.Query, f func(StreamContext) error, options ...StreamsOption) (bool, uint, *index.DataRegexes, error)

func (*View) Stream

func (v *View) Stream(streamID uint64) (StreamContext, error)

Jump to

Keyboard shortcuts

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