supervisor

package
v0.0.0-...-fc91ca8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationSupervisor

type ApplicationSupervisor struct {
	// contains filtered or unexported fields
}

func NewApplicationSupervisor

func NewApplicationSupervisor(
	applicationID string,
	engine engine.Engine,
	variables variables.Interface,
	reporter *Reporter,
	validators []validator.Validator,
) *ApplicationSupervisor

func (*ApplicationSupervisor) Set

func (s *ApplicationSupervisor) Set(bundle models.Bundle, application models.FullBundledApplication)

func (*ApplicationSupervisor) Stop

func (s *ApplicationSupervisor) Stop()

type Lookup

type Lookup interface {
	GetContainerID(applicationID string, service string) (string, bool)
	GetImagePullProgress(applicationID string, service string) (map[string]PullEvent, bool)
}

type PullEvent

type PullEvent struct {
	ID             string `json:"id"`
	Status         string `json:"status"`
	Error          string `json:"error,omitempty"`
	Progress       string `json:"progress,omitempty"`
	ProgressDetail struct {
		Current int `json:"current"`
		Total   int `json:"total"`
	} `json:"progressDetail"`
}

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

func NewReporter

func NewReporter(
	applicationID string,
	reportApplicationStatus func(ctx *dpcontext.Context, applicationID, currentRelease string) error,
	reportServiceStatus func(ctx *dpcontext.Context, applicationID, service string, req models.SetDeviceServiceStatusRequest) error,
	reportServiceState func(ctx *dpcontext.Context, applicationID, service string, req models.SetDeviceServiceStateRequest) error,
) *Reporter

func (*Reporter) SetDesiredApplication

func (r *Reporter) SetDesiredApplication(release string, applicationConfig map[string]models.Service)

func (*Reporter) SetServiceState

func (r *Reporter) SetServiceState(serviceName string, state models.SetDeviceServiceStateRequest)

func (*Reporter) SetServiceStatus

func (r *Reporter) SetServiceStatus(serviceName string, status models.SetDeviceServiceStatusRequest)

func (*Reporter) Stop

func (r *Reporter) Stop()

type ServiceSupervisor

type ServiceSupervisor struct {
	// contains filtered or unexported fields
}

func NewServiceSupervisor

func NewServiceSupervisor(
	applicationID string,
	serviceName string,
	engine engine.Engine,
	variables variables.Interface,
	reporter *Reporter,
	validators []validator.Validator,
) *ServiceSupervisor

func (*ServiceSupervisor) Set

func (s *ServiceSupervisor) Set(bundle models.Bundle, release string, service models.Service)

func (*ServiceSupervisor) Stop

func (s *ServiceSupervisor) Stop()

type Supervisor

type Supervisor struct {
	// contains filtered or unexported fields
}

func NewSupervisor

func NewSupervisor(
	engine engine.Engine,
	variables variables.Interface,
	reportApplicationStatus func(ctx *dpcontext.Context, applicationID, currentReleaseID string) error,
	reportServiceStatus func(ctx *dpcontext.Context, applicationID, service string, req models.SetDeviceServiceStatusRequest) error,
	reportServiceState func(ctx *dpcontext.Context, applicationID, service string, req models.SetDeviceServiceStateRequest) error,
	validators []validator.Validator,
) *Supervisor

func (*Supervisor) GetContainerID

func (s *Supervisor) GetContainerID(applicationID, service string) (string, bool)

func (*Supervisor) GetImagePullProgress

func (s *Supervisor) GetImagePullProgress(applicationID, service string) (map[string]PullEvent, bool)

func (*Supervisor) Set

func (s *Supervisor) Set(bundle models.Bundle, applications []models.FullBundledApplication)

Jump to

Keyboard shortcuts

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