logic

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JOB_LIFETIME           = time.Hour * 1
	JANITOR_SLEEP_DURATION = time.Minute * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminLogic

type AdminLogic interface {
	RunEnvironmentScaler(string) (*models.ScalerRunInfo, error)
	UpdateSQL() error
}

type DeployLogic

type DeployLogic interface {
	ListDeploys() ([]*models.DeploySummary, error)
	GetDeploy(deployID string) (*models.Deploy, error)
	DeleteDeploy(deployID string) error
	CreateDeploy(model models.CreateDeployRequest) (*models.Deploy, error)
}

type EnvironmentLogic

type EnvironmentLogic interface {
	ListEnvironments() ([]models.EnvironmentSummary, error)
	GetEnvironment(id string) (*models.Environment, error)
	DeleteEnvironment(id string) error
	CanCreateEnvironment(req models.CreateEnvironmentRequest) (bool, error)
	CreateEnvironment(req models.CreateEnvironmentRequest) (*models.Environment, error)
	UpdateEnvironment(id string, minClusterCount int) (*models.Environment, error)
	CreateEnvironmentLink(sourceEnvironmentID, destEnvironmentID string) error
	DeleteEnvironmentLink(sourceEnvironmentID, destEnvironmentID string) error
}

type EnvironmentResourceGetter

type EnvironmentResourceGetter struct {
	ServiceLogic ServiceLogic
	TaskLogic    TaskLogic
	DeployLogic  DeployLogic
	JobLogic     JobLogic
	// contains filtered or unexported fields
}

func (*EnvironmentResourceGetter) GetConsumers

func (c *EnvironmentResourceGetter) GetConsumers(environmentID string) ([]resource.ResourceConsumer, error)

type JobJanitor

type JobJanitor struct {
	Clock waitutils.Clock
	// contains filtered or unexported fields
}

func NewJobJanitor

func NewJobJanitor(jobLogic JobLogic) *JobJanitor

func (*JobJanitor) Run

func (this *JobJanitor) Run()

type JobLogic

type JobLogic interface {
	ListJobs() ([]*models.Job, error)
	GetJob(string) (*models.Job, error)
	CreateJob(types.JobType, interface{}) (*models.Job, error)
	Delete(string) error
}

type L0AdminLogic

type L0AdminLogic struct {
	Logic
}

func NewL0AdminLogic

func NewL0AdminLogic(l Logic) *L0AdminLogic

func (*L0AdminLogic) RunEnvironmentScaler

func (a *L0AdminLogic) RunEnvironmentScaler(environmentID string) (*models.ScalerRunInfo, error)

func (*L0AdminLogic) UpdateSQL

func (a *L0AdminLogic) UpdateSQL() error

type L0DeployLogic

type L0DeployLogic struct {
	Logic
}

func NewL0DeployLogic

func NewL0DeployLogic(lgc Logic) *L0DeployLogic

func (*L0DeployLogic) CreateDeploy

func (d *L0DeployLogic) CreateDeploy(req models.CreateDeployRequest) (*models.Deploy, error)

func (*L0DeployLogic) DeleteDeploy

func (d *L0DeployLogic) DeleteDeploy(deployID string) error

func (*L0DeployLogic) GetDeploy

func (d *L0DeployLogic) GetDeploy(deployID string) (*models.Deploy, error)

func (*L0DeployLogic) ListDeploys

func (d *L0DeployLogic) ListDeploys() ([]*models.DeploySummary, error)

type L0EnvironmentLogic

type L0EnvironmentLogic struct {
	Logic
}

func NewL0EnvironmentLogic

func NewL0EnvironmentLogic(logic Logic) *L0EnvironmentLogic

func (*L0EnvironmentLogic) CanCreateEnvironment

func (e *L0EnvironmentLogic) CanCreateEnvironment(req models.CreateEnvironmentRequest) (bool, error)

func (*L0EnvironmentLogic) CreateEnvironment

func (e *L0EnvironmentLogic) CreateEnvironmentLink(sourceEnvironmentID, destEnvironmentID string) error

func (*L0EnvironmentLogic) DeleteEnvironment

func (e *L0EnvironmentLogic) DeleteEnvironment(environmentID string) error
func (e *L0EnvironmentLogic) DeleteEnvironmentLink(sourceEnvironmentID, destEnvironmentID string) error

func (*L0EnvironmentLogic) GetEnvironment

func (e *L0EnvironmentLogic) GetEnvironment(environmentID string) (*models.Environment, error)

func (*L0EnvironmentLogic) ListEnvironments

func (e *L0EnvironmentLogic) ListEnvironments() ([]models.EnvironmentSummary, error)

func (*L0EnvironmentLogic) UpdateEnvironment

func (e *L0EnvironmentLogic) UpdateEnvironment(environmentID string, minClusterCount int) (*models.Environment, error)

type L0JobLogic

type L0JobLogic struct {
	Logic
	TaskLogic   TaskLogic
	DeployLogic DeployLogic
}

func NewL0JobLogic

func NewL0JobLogic(logic Logic, taskLogic TaskLogic, deployLogic DeployLogic) *L0JobLogic

func (*L0JobLogic) CreateJob

func (this *L0JobLogic) CreateJob(jobType types.JobType, request interface{}) (*models.Job, error)

func (*L0JobLogic) Delete

func (this *L0JobLogic) Delete(jobID string) error

func (*L0JobLogic) GetJob

func (this *L0JobLogic) GetJob(jobID string) (*models.Job, error)

func (*L0JobLogic) ListJobs

func (this *L0JobLogic) ListJobs() ([]*models.Job, error)

type L0LoadBalancerLogic

type L0LoadBalancerLogic struct {
	Logic
}

func NewL0LoadBalancerLogic

func NewL0LoadBalancerLogic(logic Logic) *L0LoadBalancerLogic

func (*L0LoadBalancerLogic) CreateLoadBalancer

func (*L0LoadBalancerLogic) DeleteLoadBalancer

func (l *L0LoadBalancerLogic) DeleteLoadBalancer(loadBalancerID string) error

func (*L0LoadBalancerLogic) GetLoadBalancer

func (l *L0LoadBalancerLogic) GetLoadBalancer(loadBalancerID string) (*models.LoadBalancer, error)

func (*L0LoadBalancerLogic) ListLoadBalancers

func (l *L0LoadBalancerLogic) ListLoadBalancers() ([]*models.LoadBalancerSummary, error)

func (*L0LoadBalancerLogic) UpdateLoadBalancerHealthCheck

func (l *L0LoadBalancerLogic) UpdateLoadBalancerHealthCheck(loadBalancerID string, healthCheck models.HealthCheck) (*models.LoadBalancer, error)

func (*L0LoadBalancerLogic) UpdateLoadBalancerPorts

func (l *L0LoadBalancerLogic) UpdateLoadBalancerPorts(loadBalancerID string, ports []models.Port) (*models.LoadBalancer, error)

type L0ServiceLogic

type L0ServiceLogic struct {
	Logic
}

func NewL0ServiceLogic

func NewL0ServiceLogic(logic Logic) *L0ServiceLogic

func (*L0ServiceLogic) CreateService

func (this *L0ServiceLogic) CreateService(req models.CreateServiceRequest) (*models.Service, error)

func (*L0ServiceLogic) DeleteService

func (this *L0ServiceLogic) DeleteService(serviceID string) error

func (*L0ServiceLogic) GetEnvironmentServices added in v0.10.4

func (this *L0ServiceLogic) GetEnvironmentServices(environmentID string) ([]*models.Service, error)

func (*L0ServiceLogic) GetService

func (this *L0ServiceLogic) GetService(serviceID string) (*models.Service, error)

func (*L0ServiceLogic) GetServiceLogs

func (this *L0ServiceLogic) GetServiceLogs(serviceID, start, end string, tail int) ([]*models.LogFile, error)

func (*L0ServiceLogic) ListServices

func (this *L0ServiceLogic) ListServices() ([]models.ServiceSummary, error)

func (*L0ServiceLogic) ScaleService

func (this *L0ServiceLogic) ScaleService(serviceID string, size int) (*models.Service, error)

func (*L0ServiceLogic) UpdateService

func (this *L0ServiceLogic) UpdateService(serviceID string, req models.UpdateServiceRequest) (*models.Service, error)

type L0TaskLogic

type L0TaskLogic struct {
	Logic
}

func NewL0TaskLogic

func NewL0TaskLogic(logic Logic) *L0TaskLogic

func (*L0TaskLogic) CreateTask

func (this *L0TaskLogic) CreateTask(req models.CreateTaskRequest) (string, error)

func (*L0TaskLogic) DeleteTask

func (this *L0TaskLogic) DeleteTask(taskID string) error

func (*L0TaskLogic) GetEnvironmentTasks added in v0.10.4

func (this *L0TaskLogic) GetEnvironmentTasks(environmentID string) ([]*models.Task, error)

func (*L0TaskLogic) GetTask

func (this *L0TaskLogic) GetTask(taskID string) (*models.Task, error)

func (*L0TaskLogic) GetTaskLogs

func (this *L0TaskLogic) GetTaskLogs(taskID, start, end string, tail int) ([]*models.LogFile, error)

func (*L0TaskLogic) ListTasks

func (this *L0TaskLogic) ListTasks() ([]*models.TaskSummary, error)

type LoadBalancerLogic

type LoadBalancerLogic interface {
	ListLoadBalancers() ([]*models.LoadBalancerSummary, error)
	GetLoadBalancer(loadBalancerID string) (*models.LoadBalancer, error)
	DeleteLoadBalancer(loadBalancerID string) error
	CreateLoadBalancer(req models.CreateLoadBalancerRequest) (*models.LoadBalancer, error)
	UpdateLoadBalancerPorts(loadBalancerID string, ports []models.Port) (*models.LoadBalancer, error)
	UpdateLoadBalancerHealthCheck(loadBalancerID string, healthCheck models.HealthCheck) (*models.LoadBalancer, error)
}

type Logic

type Logic struct {
	Backend  backend.Backend
	TagStore tag_store.TagStore
	JobStore job_store.JobStore
	Scaler   scheduler.EnvironmentScaler
}

func NewLogic

func NewLogic(
	tagStore tag_store.TagStore,
	jobData job_store.JobStore,
	backend backend.Backend,
	scaler scheduler.EnvironmentScaler,
) *Logic

type ServiceLogic

type ServiceLogic interface {
	ListServices() ([]models.ServiceSummary, error)
	GetService(serviceID string) (*models.Service, error)
	GetEnvironmentServices(environmentID string) ([]*models.Service, error)
	CreateService(req models.CreateServiceRequest) (*models.Service, error)
	DeleteService(serviceID string) error
	UpdateService(serviceID string, req models.UpdateServiceRequest) (*models.Service, error)
	ScaleService(serviceID string, size int) (*models.Service, error)
	GetServiceLogs(serviceID, start, end string, tail int) ([]*models.LogFile, error)
}

type TagJanitor added in v0.10.3

type TagJanitor struct {
	TaskLogic TaskLogic
	TagStore  tag_store.TagStore
	Clock     waitutils.Clock
}

func NewTagJanitor added in v0.10.3

func NewTagJanitor(taskLogic TaskLogic, tagStore tag_store.TagStore) *TagJanitor

func (*TagJanitor) Run added in v0.10.3

func (t *TagJanitor) Run()

type TaskLogic

type TaskLogic interface {
	CreateTask(models.CreateTaskRequest) (string, error)
	ListTasks() ([]*models.TaskSummary, error)
	GetTask(string) (*models.Task, error)
	GetEnvironmentTasks(environmentID string) ([]*models.Task, error)
	DeleteTask(string) error
	GetTaskLogs(string, string, string, int) ([]*models.LogFile, error)
}

Directories

Path Synopsis
Package mock_logic is a generated GoMock package.
Package mock_logic is a generated GoMock package.

Jump to

Keyboard shortcuts

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