mirror

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// UpdateModule creates a module config, writes rules, and publishes
	// it to the dataplane.
	UpdateModule(name string, rules []cmirror.MirrorRule) (ModuleHandle, error)
	// DeleteModule removes a module config.
	DeleteModule(name string) error
}

Backend abstracts shared memory operations.

func NewBackend

func NewBackend(agent *ffi.Agent) Backend

NewBackend creates a Backend that operates on real shared memory.

type Config

type Config struct {
	ffi.AttachConfig `yaml:",inline"`

	Endpoint xcfg.NonEmptyString `yaml:"endpoint"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Default

func (m *Config) Default()

Default resets Config to DefaultConfig.

type MirrorModule

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

MirrorModule is a control-plane component of a module that is responsible for mirroring traffic between devices.

func NewMirrorModule

func NewMirrorModule(cfg *Config, options ...Option) (*MirrorModule, error)

func (*MirrorModule) Close

func (m *MirrorModule) Close() error

Close closes the module.

func (*MirrorModule) Endpoint

func (m *MirrorModule) Endpoint() string

func (*MirrorModule) Name

func (m *MirrorModule) Name() string

func (*MirrorModule) RegisterService

func (m *MirrorModule) RegisterService(server *grpc.Server)

func (*MirrorModule) ServicesNames

func (m *MirrorModule) ServicesNames() []string

type MirrorService

type MirrorService struct {
	mirrorpb.UnimplementedMirrorServiceServer
	// contains filtered or unexported fields
}

func NewMirrorService

func NewMirrorService(backend Backend) *MirrorService

func (*MirrorService) DeleteConfig

func (*MirrorService) ListConfigs

func (*MirrorService) ShowConfig

func (*MirrorService) UpdateConfig

type ModuleHandle

type ModuleHandle interface {
	Free() error
}

ModuleHandle is a handle to a module configuration.

type Option

type Option func(*moduleOptions)

Option configures the MirrorModule constructor.

func WithLog

func WithLog(log *zap.Logger) Option

WithLog sets the logger for the mirror module.

Directories

Path Synopsis
mirrorpb
v1

Jump to

Keyboard shortcuts

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