scheduling

package
v0.0.0-...-27b20b4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FIFOPrefix = "tko-scheduling-"

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Scheduling              *Scheduling
	Log                     commonlog.Logger
	SiteID                  string
	SitePackage             util.Package
	TargetResourceIdentifer util.ResourceIdentifier
	Deployments             map[string]util.Package
}

func (*Context) GetResource

func (self *Context) GetResource() (util.Resource, bool)

func (*Context) ToPluginInput

func (self *Context) ToPluginInput(logFile string, logAddressPort string) PluginInput

type Controller

type Controller struct {
	*util.Controller

	Scheduling *Scheduling
	// contains filtered or unexported fields
}

func NewController

func NewController(scheduling *Scheduling, interval time.Duration, log commonlog.Logger) *Controller

type PluginInput

type PluginInput struct {
	GRPC                    PluginInputGRPC            `yaml:"grpc"`
	LogFile                 string                     `yaml:"logFile"`
	LogAddressPort          string                     `yaml:"logAddressPort"`
	SiteID                  string                     `yaml:"siteId"`
	SitePackage             tkoutil.Package            `yaml:"sitePackage"`
	TargetResourceIdentifer tkoutil.ResourceIdentifier `yaml:"targetResourceIdentifier"`
	Deployments             map[string]tkoutil.Package `yaml:"deployments"`
}

type PluginInputGRPC

type PluginInputGRPC struct {
	Level2Protocol string `yaml:"level2protocol"`
	Address        string `yaml:"address"`
	Port           int    `yaml:"port"`
}

type PluginOutput

type PluginOutput struct {
	Error string `yaml:"error,omitempty"`
}

type ScheduleFunc

type ScheduleFunc func(context contextpkg.Context, schedulingContext *Context) error

func NewAnsiblePluginScheduler

func NewAnsiblePluginScheduler(plugin client.Plugin) (ScheduleFunc, error)

func NewCommandPluginScheduler

func NewCommandPluginScheduler(plugin client.Plugin, logIpStack util.IPStack, logAddress string, logPort int) (ScheduleFunc, error)

func NewPluginScheduler

func NewPluginScheduler(plugin client.Plugin, logIpStack util.IPStack, logAddress string, logPort int) (ScheduleFunc, error)

type Schedulers

type Schedulers []ScheduleFunc

type SchedulersMap

type SchedulersMap map[tkoutil.GVK]Schedulers

type Scheduling

type Scheduling struct {
	Client     *clientpkg.Client
	Timeout    time.Duration
	Log        commonlog.Logger
	LogIPStack util.IPStack
	LogAddress string
	LogPort    int
	// contains filtered or unexported fields
}

func NewScheduling

func NewScheduling(client *clientpkg.Client, timeout time.Duration, log commonlog.Logger, logIpStack util.IPStack, logAddress string, logPort int) *Scheduling

func (*Scheduling) GetSchedulers

func (self *Scheduling) GetSchedulers(gvk tkoutil.GVK) (Schedulers, error)

func (*Scheduling) NewContext

func (self *Scheduling) NewContext(siteId string, sitePackage util.Package, targetResourceIdentifer util.ResourceIdentifier, deployments map[string]util.Package, log commonlog.Logger) *Context

func (*Scheduling) RegisterScheduler

func (self *Scheduling) RegisterScheduler(gvk tkoutil.GVK, schedule ScheduleFunc)

func (*Scheduling) ResetPluginCache

func (self *Scheduling) ResetPluginCache()

func (*Scheduling) ScheduleSite

func (self *Scheduling) ScheduleSite(siteInfo client.SiteInfo) error

func (*Scheduling) ScheduleSites

func (self *Scheduling) ScheduleSites() error

Jump to

Keyboard shortcuts

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