Documentation
¶
Index ¶
- type Backend
- type Config
- type MirrorModule
- type MirrorService
- func (m *MirrorService) DeleteConfig(ctx context.Context, req *mirrorpb.DeleteConfigRequest) (*mirrorpb.DeleteConfigResponse, error)
- func (m *MirrorService) ListConfigs(ctx context.Context, request *mirrorpb.ListConfigsRequest) (*mirrorpb.ListConfigsResponse, error)
- func (m *MirrorService) ShowConfig(ctx context.Context, req *mirrorpb.ShowConfigRequest) (*mirrorpb.ShowConfigResponse, error)
- func (m *MirrorService) UpdateConfig(ctx context.Context, req *mirrorpb.UpdateConfigRequest) (*mirrorpb.UpdateConfigResponse, error)
- 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 []cmirror.MirrorRule) (ModuleHandle, error)
// DeleteModule removes a module config.
DeleteModule(name string) error
}
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 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) 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 (m *MirrorService) DeleteConfig( ctx context.Context, req *mirrorpb.DeleteConfigRequest, ) (*mirrorpb.DeleteConfigResponse, error)
func (*MirrorService) ListConfigs ¶
func (m *MirrorService) ListConfigs( ctx context.Context, request *mirrorpb.ListConfigsRequest, ) (*mirrorpb.ListConfigsResponse, error)
func (*MirrorService) ShowConfig ¶
func (m *MirrorService) ShowConfig( ctx context.Context, req *mirrorpb.ShowConfigRequest, ) (*mirrorpb.ShowConfigResponse, error)
func (*MirrorService) UpdateConfig ¶
func (m *MirrorService) UpdateConfig( ctx context.Context, req *mirrorpb.UpdateConfigRequest, ) (*mirrorpb.UpdateConfigResponse, error)
type ModuleHandle ¶
type ModuleHandle interface {
Free() error
}
ModuleHandle is a handle to a module configuration.