plain

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 16 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 Config

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

	// Endpoint is the gRPC endpoint address
	Endpoint xcfg.NonEmptyString `yaml:"endpoint"`
}

Config represents plain device configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default configuration

func (*Config) Default

func (m *Config) Default()

Default resets Config to DefaultConfig.

type DeviceConfig

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

DeviceConfig wraps C module configuration

func NewDeviceConfig

func NewDeviceConfig(
	agent *ffi.Agent,
	name string,
	device *commonpb.Device,
) (
	*DeviceConfig,
	error,
)

NewDeviceConfig creates a new balancer module configuration

func UpdateDevices

func UpdateDevices(agent *ffi.Agent, devices []ffi.DeviceConfig) ([]*DeviceConfig, error)

UpdateDevices creates one plain device per configuration and publishes them all in a single configuration update, returning the created handles in order.

The caller becomes the owner of the returned handles: each device is referenced by the live generation, so freeing a handle now is refused with ffi.ErrStillReferenced and the owner must retry once the generations drain. On failure every handle is destroyed here — the devices were never registered — and nil is returned.

func (*DeviceConfig) AsFFIDevice

func (m *DeviceConfig) AsFFIDevice() ffi.ShmDeviceConfig

AsFFIDevice returns the module configuration as an FFI module

func (*DeviceConfig) Free

func (m *DeviceConfig) Free() error

Free destroys the device, or reports ffi.ErrStillReferenced while a live generation still holds it. Safe to call multiple times.

type DevicePlainDevice

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

DevicePlainDevice is a control-plane component responsible for plain devices

func NewDevicePlainDevice

func NewDevicePlainDevice(cfg *Config, options ...Option) (*DevicePlainDevice, error)

NewDevicePlainDevice creates a new DevicePlain device instance

func (*DevicePlainDevice) Close

func (m *DevicePlainDevice) Close() error

Close closes the device and releases all resources

func (*DevicePlainDevice) Endpoint

func (m *DevicePlainDevice) Endpoint() string

func (*DevicePlainDevice) Name

func (m *DevicePlainDevice) Name() string

func (*DevicePlainDevice) RegisterService

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

func (*DevicePlainDevice) ServicesNames

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

type DevicePlainService

type DevicePlainService struct {
	plainpb.UnimplementedDevicePlainServiceServer
	// contains filtered or unexported fields
}

DevicePlainService implements the DevicePlain gRPC service.

func NewDevicePlainService

func NewDevicePlainService(agent *ffi.Agent) *DevicePlainService

func (*DevicePlainService) ShowDevice added in v0.1.0

ShowDevice returns the pipeline bindings of the plain device with the given name, read from the dataplane's live device registry rather than this service's in-memory state.

func (*DevicePlainService) UpdateDevice

type Option

type Option func(*deviceOptions)

Option configures the DevicePlainDevice constructor.

func WithLog

func WithLog(log *zap.Logger) Option

WithLog sets the logger for the plain device.

Directories

Path Synopsis
plainpb
v1

Jump to

Keyboard shortcuts

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