di

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package di organizes the dependencies. All services are only initialized on this package. di means dependency injection.

Index

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,
	etcdclient *clientv3.Client,
	restclientCfg *restclient.Config,
	initialSchedulerCfg *configv1.KubeSchedulerConfiguration,
	externalImportEnabled bool,
	externalClient clientset.Interface,
	externalSchedulerEnabled bool,
	simulatorPort int,
) (*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) ImportClusterResourceService added in v0.1.1

func (c *Container) ImportClusterResourceService() ImportClusterResourceService

ImportClusterResourceService returns ImportClusterResourceService. Note: this service will return nil when `externalImportEnabled` is false.

func (*Container) ResetService

func (c *Container) ResetService() ResetService

ResetService returns ResetService.

func (*Container) ResourceWatcherService

func (c *Container) ResourceWatcherService() ResourceWatcherService

ResourceWatcherService returns ResourceWatcherService.

func (*Container) SchedulerService

func (c *Container) SchedulerService() SchedulerService

SchedulerService returns SchedulerService.

type ExtenderService

ExtenderService represents service for the extender of scheduler.

type ImportClusterResourceService added in v0.1.1

type ImportClusterResourceService interface {
	ImportClusterResources(ctx context.Context) error
}

ImportClusterResourceService represents a service to import resources from an target cluster.

type ResetService

type ResetService interface {
	Reset(ctx context.Context) error
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL