Documentation
¶
Index ¶
- type ServiceController
- func (s *ServiceController) Create(ctx context.Context, srv *network_v1alpha.Service, meta *entity.Meta) error
- func (s *ServiceController) Delete(ctx context.Context, id entity.Id, obj *network_v1alpha.Service) error
- func (s *ServiceController) Init(ctx context.Context) error
- func (s *ServiceController) Periodic(ctx context.Context) error
- func (s *ServiceController) UpdateEndpoints(ctx context.Context, event controller.Event) ([]entity.Attr, error)
- type ServiceControllerDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceController ¶
type ServiceController struct {
Log *slog.Logger
EAC *entityserver_v1alpha.EntityAccessClient
IPv4Routable netip.Prefix
ServicePrefixes []netip.Prefix
DisableLocalNet bool
// contains filtered or unexported fields
}
func NewServiceController ¶ added in v0.3.0
func NewServiceController(cfg ServiceControllerDeps) (*ServiceController, error)
NewServiceController creates a new ServiceController with validated dependencies.
func (*ServiceController) Create ¶
func (s *ServiceController) Create(ctx context.Context, srv *network_v1alpha.Service, meta *entity.Meta) error
func (*ServiceController) Delete ¶
func (s *ServiceController) Delete(ctx context.Context, id entity.Id, obj *network_v1alpha.Service) error
func (*ServiceController) Periodic ¶ added in v0.8.0
func (s *ServiceController) Periodic(ctx context.Context) error
Periodic runs cluster-level GC: lists all live Service and Endpoints entities, snapshots the kernel state, and prunes anything in the kernel that no current entity claims. Designed to run on the controller's periodic tick (registered via SetPeriodic in runner.go).
func (*ServiceController) UpdateEndpoints ¶
func (s *ServiceController) UpdateEndpoints(ctx context.Context, event controller.Event) ([]entity.Attr, error)
type ServiceControllerDeps ¶ added in v0.3.0
type ServiceControllerDeps struct {
Log *slog.Logger
EAC *entityserver_v1alpha.EntityAccessClient
IPv4Routable netip.Prefix
ServicePrefixes []netip.Prefix
DisableLocalNet bool
}
ServiceControllerDeps holds required dependencies for ServiceController.
Click to show internal directories.
Click to hide internal directories.