Documentation
¶
Index ¶
- type Backend
- type Config
- type CounterView
- type ForwardModule
- type ForwardService
- func (m *ForwardService) DeleteConfig(ctx context.Context, req *forwardpb.DeleteConfigRequest) (*forwardpb.DeleteConfigResponse, error)
- func (m *ForwardService) ListConfigs(ctx context.Context, request *forwardpb.ListConfigsRequest) (*forwardpb.ListConfigsResponse, error)
- func (m *ForwardService) Metrics(tags ...*commonpb.MetricTag) ([]*commonpb.Metric, error)
- func (m *ForwardService) ShowConfig(ctx context.Context, req *forwardpb.ShowConfigRequest) (*forwardpb.ShowConfigResponse, error)
- func (m *ForwardService) UpdateConfig(ctx context.Context, req *forwardpb.UpdateConfigRequest) (*forwardpb.UpdateConfigResponse, error)
- type MetricsService
- type ModuleHandle
- type Option
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 []cforward.ForwardRule) (ModuleHandle, error)
// DeleteModule removes a module config.
DeleteModule(name string) error
// ModuleCounters returns selected dataplane counters collected for a module config.
// If counterNames is nil or empty, it returns all counters for the module config.
ModuleCounters(name string, counterNames []string) []CounterView
}
Backend abstracts shared memory operations.
func NewBackend ¶
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
type CounterView ¶
type ForwardModule ¶
type ForwardModule struct {
// contains filtered or unexported fields
}
ForwardModule is a control-plane component of a module that is responsible for forwarding traffic between devices.
func NewForwardModule ¶
func NewForwardModule(cfg *Config, options ...Option) (*ForwardModule, error)
func (*ForwardModule) Endpoint ¶
func (m *ForwardModule) Endpoint() string
func (*ForwardModule) Name ¶
func (m *ForwardModule) Name() string
func (*ForwardModule) RegisterService ¶
func (m *ForwardModule) RegisterService(server *grpc.Server)
func (*ForwardModule) ServicesNames ¶
func (m *ForwardModule) ServicesNames() []string
type ForwardService ¶
type ForwardService struct {
forwardpb.UnimplementedForwardServiceServer
// contains filtered or unexported fields
}
func NewForwardService ¶
func NewForwardService(backend Backend) *ForwardService
func (*ForwardService) DeleteConfig ¶
func (m *ForwardService) DeleteConfig(ctx context.Context, req *forwardpb.DeleteConfigRequest) (*forwardpb.DeleteConfigResponse, error)
func (*ForwardService) ListConfigs ¶
func (m *ForwardService) ListConfigs( ctx context.Context, request *forwardpb.ListConfigsRequest, ) (*forwardpb.ListConfigsResponse, error)
func (*ForwardService) Metrics ¶
Metrics returns Forward per-rule metrics matching tags, collected from the dataplane.
func (*ForwardService) ShowConfig ¶
func (m *ForwardService) ShowConfig(ctx context.Context, req *forwardpb.ShowConfigRequest) (*forwardpb.ShowConfigResponse, error)
func (*ForwardService) UpdateConfig ¶
func (m *ForwardService) UpdateConfig(ctx context.Context, req *forwardpb.UpdateConfigRequest) (*forwardpb.UpdateConfigResponse, error)
UpdateConfig replaces the rule set for a named forward module config and publishes it to the dataplane.
A rule that leaves its counter empty is stored with "to_" plus its target, bounded to the counter-name limit, so ShowConfig never returns an empty name for a rule applied here. A non-empty counter is passed through verbatim.
type MetricsService ¶
type MetricsService struct {
forwardpb.UnimplementedMetricsServiceServer
// contains filtered or unexported fields
}
MetricsService exposes Forward module per-rule metrics over its own gRPC service.
func NewMetricsService ¶
func NewMetricsService(source metricsSource) *MetricsService
NewMetricsService creates a MetricsService backed by source.
func (*MetricsService) GetMetrics ¶
func (m *MetricsService) GetMetrics(ctx context.Context, req *commonpb.GetMetricsRequest) (*commonpb.GetMetricsResponse, error)
GetMetrics returns a snapshot of Forward per-rule metrics matching the request's tags.
type ModuleHandle ¶
type ModuleHandle interface {
Free() error
}
ModuleHandle is a handle to a module configuration.