interfaces

package
v0.0.0-...-437b0eb Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 1 Imported by: 14

Documentation

Index

Constants

View Source
const DefaultFlowName = "DEFAULT"

DefaultFlowName is the name of default flow (main dependency graph)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResource

type BaseResource interface {
	Key() string
	// Ensure that Status() supports nil as meta
	Status(meta map[string]string) (ResourceStatus, error)
	Create() error
	Delete() error
	Meta(string) interface{}
}

BaseResource is an interface for AppController supported resources

type DependencyGraph

type DependencyGraph interface {
	GetStatus() (DeploymentStatus, DeploymentReport)
	Deploy(<-chan struct{})
	Options() DependencyGraphOptions
}

DependencyGraph represents operations on dependency graph

type DependencyGraphOptions

type DependencyGraphOptions struct {
	FlowName                     string
	Args                         map[string]string
	ExportedOnly                 bool
	AllowUndeclaredArgs          bool
	ReplicaCount                 int
	FixedNumberOfReplicas        bool
	MinReplicaCount              int
	MaxReplicaCount              int
	AllowDeleteExternalResources bool
	FlowInstanceName             string
	Silent                       bool
}

DependencyGraphOptions contains all the input required to build a dependency graph

type DependencyReport

type DependencyReport struct {
	Dependency string
	Blocks     bool
	Percentage int
	Needed     int
	Message    string
}

DependencyReport is a report of a single dependency of a node in graph

type DeploymentReport

type DeploymentReport interface {
	AsText(int) []string
}

DeploymentReport is an interface to get string representation of current deployment progress

type DeploymentStatus

type DeploymentStatus int

DeploymentStatus describes possible status of whole deployment process

const (
	Empty DeploymentStatus = iota
	Prepared
	Running
	Finished
	TimedOut
)

Possible values for DeploymentStatus

func (DeploymentStatus) String

func (s DeploymentStatus) String() string

type GraphContext

type GraphContext interface {
	Scheduler() Scheduler
	GetArg(string) string
	Graph() DependencyGraph
	Dependency() *client.Dependency
}

GraphContext represents context of dependency graph. Resource factories get implementation of this interface so that they can get graph, they created in, its options, arguments and call Scheduler API

type Resource

type Resource interface {
	BaseResource
	GetDependencyReport(map[string]string) DependencyReport
}

Resource is an interface for a base resource that implements getting dependency reports

type ResourceStatus

type ResourceStatus string

ResourceStatus is an enum of k8s resource statuses

const (
	ResourceReady    ResourceStatus = "ready"
	ResourceNotReady ResourceStatus = "not ready"
	ResourceError    ResourceStatus = "error"
)

Possible ResourceStatus values

type ResourceTemplate

type ResourceTemplate interface {
	Kind() string
	ShortName(client.ResourceDefinition) string
	New(client.ResourceDefinition, client.Interface, GraphContext) Resource
	NewExisting(string, client.Interface, GraphContext) Resource
}

ResourceTemplate is an interface for AppController supported resource templates

type ScheduledResourceStatus

type ScheduledResourceStatus int

ScheduledResourceStatus describes possible status of a single resource

const (
	Init ScheduledResourceStatus = iota
	Creating
	Ready
	Error
)

Possible values for ScheduledResourceStatus

type Scheduler

type Scheduler interface {
	BuildDependencyGraph(options DependencyGraphOptions) (DependencyGraph, error)
	Serialize(options DependencyGraphOptions) map[string]string
	CreateDeployment(options DependencyGraphOptions) (string, error)
}

Scheduler interface is an API to build dependency graphs and manage their settings

Jump to

Keyboard shortcuts

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