remote

package
v0.0.0-...-73f4ec9 Latest Latest
Warning

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

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

Documentation

Overview

Package remote implements a generic workloadmeta Collector that receives events from a remote workloadmeta server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericCollector

type GenericCollector struct {
	CollectorID   string
	Catalog       workloadmeta.AgentType
	StreamHandler StreamHandler

	Insecure bool // for testing
	// contains filtered or unexported fields
}

GenericCollector is a generic remote workloadmeta collector with resync mechanisms.

func (*GenericCollector) GetID

func (c *GenericCollector) GetID() string

GetID gets the identifier for the generic collector

func (*GenericCollector) GetTargetCatalog

func (c *GenericCollector) GetTargetCatalog() workloadmeta.AgentType

GetTargetCatalog gets the catalog this collector should target

func (*GenericCollector) Pull

Pull does nothing in workloadmeta collectors.

func (*GenericCollector) Run

func (c *GenericCollector) Run()

Run will run the generic collector streaming loop

func (*GenericCollector) Start

Start starts the generic collector

type GrpcClient

type GrpcClient interface {
	// StreamEntities establishes the stream between the client and the remote gRPC server.
	StreamEntities(ctx context.Context) (Stream, error)
}

GrpcClient interface that represents a gRPC client for the remote workloadmeta.

type Stream

type Stream interface {
	// Recv returns a response of the gRPC server
	Recv() (interface{}, error)
}

Stream is an interface that represents a gRPC stream.

type StreamHandler

type StreamHandler interface {
	// Port returns the targeted port
	Port() int
	// IsEnabled returns if the feature is enabled
	IsEnabled() bool
	// NewClient returns a client to connect to a remote gRPC server.
	NewClient(cc grpc.ClientConnInterface) GrpcClient
	// HandleResponse handles a response from the remote gRPC server.
	HandleResponse(store workloadmeta.Component, response interface{}) ([]workloadmeta.CollectorEvent, error)
	// HandleResync is called on resynchronization.
	HandleResync(store workloadmeta.Component, events []workloadmeta.CollectorEvent)
}

StreamHandler is an interface that defines a gRPC stream handler.

Directories

Path Synopsis
Package processcollector implements the remote process collector for Workloadmeta.
Package processcollector implements the remote process collector for Workloadmeta.
Package workloadmeta implements the remote workloadmeta Collector.
Package workloadmeta implements the remote workloadmeta Collector.

Jump to

Keyboard shortcuts

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