mirror

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 13 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 {
	// Update builds a module config from the compiled rules and
	// publishes it to the dataplane.
	Update(name string, payload RuleSet) (crud.Handle, error)
	// Delete removes a module config.
	Delete(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 {
	modulebase.BaseConfig `yaml:",inline"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Default

func (m *Config) Default()

Default resets Config to DefaultConfig.

type MirrorModule

type MirrorModule struct {
	*modulebase.Base
}

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)

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 Option

type Option = modulebase.Option

Option configures the MirrorModule constructor.

func WithLog

func WithLog(log *zap.Logger) Option

WithLog sets the logger for the mirror module.

type RuleSet added in v0.4.0

type RuleSet struct {
	// Rules is the rule document exactly as accepted, echoed by reads.
	Rules []*mirrorpb.Rule
	// Compiled is the rule document in the representation shared memory
	// publishes.
	Compiled []cmirror.MirrorRule
}

RuleSet is the published payload: the accepted rule document together with its shared-memory representation.

Directories

Path Synopsis
mirrorpb
v1

Jump to

Keyboard shortcuts

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