Documentation
¶
Index ¶
- type Backend
- type Config
- type DscpModule
- type DscpService
- func (m *DscpService) DeleteConfig(ctx context.Context, request *dscppb.DeleteConfigRequest) (*dscppb.DeleteConfigResponse, error)
- func (m *DscpService) ListConfigs(ctx context.Context, request *dscppb.ListConfigsRequest) (*dscppb.ListConfigsResponse, error)
- func (m *DscpService) ShowConfig(ctx context.Context, request *dscppb.ShowConfigRequest) (*dscppb.ShowConfigResponse, error)
- func (m *DscpService) UpdateConfig(ctx context.Context, request *dscppb.UpdateConfigRequest) (*dscppb.UpdateConfigResponse, error)
- type Option
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 prefix sets and the marking
// and publishes it to the dataplane.
Update(name string, payload *config) (crud.Handle, error)
// Delete removes a module config.
Delete(name string) error
}
Backend abstracts shared memory operations.
type Config ¶
type Config struct {
modulebase.BaseConfig `yaml:",inline"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
type DscpModule ¶
type DscpModule struct {
*modulebase.Base
}
DscpModule is a control-plane component of a module that is responsible for DSCP marking of packets.
func NewDSCPModule ¶
func NewDSCPModule(cfg *Config, options ...Option) (*DscpModule, error)
type DscpService ¶
type DscpService struct {
dscppb.UnimplementedDscpServiceServer
// contains filtered or unexported fields
}
func NewDscpService ¶
func NewDscpService(backend Backend) *DscpService
func (*DscpService) DeleteConfig ¶
func (m *DscpService) DeleteConfig( ctx context.Context, request *dscppb.DeleteConfigRequest, ) (*dscppb.DeleteConfigResponse, error)
DeleteConfig removes the named config if it is not referenced by any pipeline.
func (*DscpService) ListConfigs ¶
func (m *DscpService) ListConfigs( ctx context.Context, request *dscppb.ListConfigsRequest, ) (*dscppb.ListConfigsResponse, error)
func (*DscpService) ShowConfig ¶
func (m *DscpService) ShowConfig( ctx context.Context, request *dscppb.ShowConfigRequest, ) (*dscppb.ShowConfigResponse, error)
func (*DscpService) UpdateConfig ¶ added in v0.5.0
func (m *DscpService) UpdateConfig( ctx context.Context, request *dscppb.UpdateConfigRequest, ) (*dscppb.UpdateConfigResponse, error)
UpdateConfig replaces the whole named config, its prefix sets and its marking, with the one the request carries.
The prefix sets are kept sorted and duplicate-free, and an invalid prefix publishes nothing.