Documentation ¶
Overview ¶
Package di organizes the dependencies. All services are only initialized on this package. di means dependency injection.
Index ¶
- type Container
- func (c *Container) ExportService() SnapshotService
- func (c *Container) ExtenderService() ExtenderService
- func (c *Container) OneshotClusterResourceImporter() OneShotClusterResourceImporter
- func (c *Container) ResetService() ResetService
- func (c *Container) ResourceSyncer() ResourceSyncer
- func (c *Container) ResourceWatcherService() ResourceWatcherService
- func (c *Container) SchedulerService() SchedulerService
- type ExtenderService
- type OneShotClusterResourceImporter
- type ResetService
- type ResourceSyncer
- type ResourceWatcherService
- type SchedulerService
- type SnapshotService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container saves and provides dependencies.
func NewDIContainer ¶
func NewDIContainer( client clientset.Interface, dynamicClient dynamic.Interface, restMapper meta.RESTMapper, etcdclient *clientv3.Client, restclientCfg *restclient.Config, initialSchedulerCfg *configv1.KubeSchedulerConfiguration, externalImportEnabled bool, resourceSyncEnabled bool, externalClient clientset.Interface, externalDynamicClient dynamic.Interface, externalSchedulerEnabled bool, simulatorPort int, syncerOptions syncer.Options, ) (*Container, error)
NewDIContainer initializes Container. It initializes all service and puts to Container. Only when externalImportEnabled is true, the simulator uses externalClient and creates ImportClusterResourceService.
func (*Container) ExportService ¶
func (c *Container) ExportService() SnapshotService
ExportService returns ExportService.
func (*Container) ExtenderService ¶
func (c *Container) ExtenderService() ExtenderService
ExtenderService returns ExtenderService.
func (*Container) OneshotClusterResourceImporter ¶ added in v0.3.0
func (c *Container) OneshotClusterResourceImporter() OneShotClusterResourceImporter
OneshotClusterResourceImporter returns OneshotClusterResourceImporter. Note: this service will return nil when `externalImportEnabled` is false.
func (*Container) ResetService ¶
func (c *Container) ResetService() ResetService
ResetService returns ResetService.
func (*Container) ResourceSyncer ¶ added in v0.3.0
func (c *Container) ResourceSyncer() ResourceSyncer
ResourceSyncer returns ResourceSyncer.
func (*Container) ResourceWatcherService ¶
func (c *Container) ResourceWatcherService() ResourceWatcherService
ResourceWatcherService returns ResourceWatcherService.
func (*Container) SchedulerService ¶
func (c *Container) SchedulerService() SchedulerService
SchedulerService returns SchedulerService.
type ExtenderService ¶
type ExtenderService interface { Filter(id int, args extenderv1.ExtenderArgs) (*extenderv1.ExtenderFilterResult, error) Prioritize(id int, args extenderv1.ExtenderArgs) (*extenderv1.HostPriorityList, error) Preempt(id int, args extenderv1.ExtenderPreemptionArgs) (*extenderv1.ExtenderPreemptionResult, error) Bind(id int, args extenderv1.ExtenderBindingArgs) (*extenderv1.ExtenderBindingResult, error) }
ExtenderService represents service for the extender of scheduler.
type OneShotClusterResourceImporter ¶ added in v0.3.0
OneShotClusterResourceImporter represents a service to import resources from an target cluster when starting the simulator.
type ResetService ¶
type ResourceSyncer ¶ added in v0.3.0
type ResourceSyncer interface { // Run starts the resource syncer. // It should be run until the context is canceled. Run(ctx context.Context) error }
ResourceSyncer represents a service to constantly sync resources from an target cluster.
type ResourceWatcherService ¶
type ResourceWatcherService interface {
ListWatch(ctx context.Context, stream streamwriter.ResponseStream, lrVersions *resourcewatcher.LastResourceVersions) error
}
ResourceWatcherService represents service for watch k8s resources.
type SchedulerService ¶
type SchedulerService interface { GetSchedulerConfig() (*configv1.KubeSchedulerConfiguration, error) RestartScheduler(cfg *configv1.KubeSchedulerConfiguration) error StartScheduler(cfg *configv1.KubeSchedulerConfiguration) error ResetScheduler() error ShutdownScheduler() ExtenderService() scheduler.ExtenderService }
SchedulerService represents service for manage scheduler.
type SnapshotService ¶ added in v0.1.1
type SnapshotService interface { Snap(ctx context.Context, opts ...snapshot.Option) (*snapshot.ResourcesForSnap, error) Load(ctx context.Context, resources *snapshot.ResourcesForLoad, opts ...snapshot.Option) error IgnoreErr() snapshot.Option }
SnapshotService represents a service for exporting/importing resources on the simulator.