Documentation ¶
Index ¶
- func ParseProjectYaml(yamlStr string, strict bool) (v1.Project, error)
- func ParseYamlFileAndInterpolateEnv(fname string, strict bool) (v1.Project, error)
- func PutProjectOutputEmpty(out v1.PutProjectOutput) bool
- type AwsLifecycleHookMessage
- type AwsSpotInstanceAction
- type CalcAutoscaleInput
- type Cluster
- func (c *Cluster) AddObserver(observer ClusterObserver)
- func (c *Cluster) BroadcastDataChanged(input v1.NotifyDataChangedInput)
- func (c *Cluster) BroadcastTerminationEvent(input v1.TerminateNodeInput)
- func (c *Cluster) GetMaelstromService(node v1.NodeStatus) v1.MaelstromService
- func (c *Cluster) GetMaelstromServiceWithTimeout(node v1.NodeStatus, timeout time.Duration) v1.MaelstromService
- func (c *Cluster) GetNodeById(nodeId string) *v1.NodeStatus
- func (c *Cluster) GetNodeService(node v1.NodeStatus) v1.NodeService
- func (c *Cluster) GetNodeServiceById(nodeId string) v1.NodeService
- func (c *Cluster) GetNodeServiceWithTimeout(node v1.NodeStatus, timeout time.Duration) v1.NodeService
- func (c *Cluster) GetNodes() []v1.NodeStatus
- func (c *Cluster) GetRemoteMaelstromServices() []v1.MaelstromService
- func (c *Cluster) GetRemoteNodeServices() []v1.NodeService
- func (c *Cluster) RemoveAndBroadcast()
- func (c *Cluster) RemoveNode(nodeId string) bool
- func (c *Cluster) SetAllNodes(nodes []v1.NodeStatus)
- func (c *Cluster) SetAndBroadcastStatus(node v1.NodeStatus)
- func (c *Cluster) SetLocalMaelstromService(svc v1.MaelstromService)
- func (c *Cluster) SetNode(node v1.NodeStatus) bool
- type ClusterObserver
- type ComponentInfoByRunningCountAndReqTime
- type ComponentResolver
- type ComponentSubscriber
- type ComponentTargetByCompName
- type DbComponentResolver
- type DockerPruner
- type DurationAscend
- type ErrorCode
- type Gateway
- type ImagePuller
- type LogsHandler
- type MaelServiceImpl
- func (v *MaelServiceImpl) GetComponent(input v1.GetComponentInput) (v1.GetComponentOutput, error)
- func (v *MaelServiceImpl) GetEventSource(input v1.GetEventSourceInput) (v1.GetEventSourceOutput, error)
- func (v *MaelServiceImpl) GetProject(input v1.GetProjectInput) (v1.GetProjectOutput, error)
- func (v *MaelServiceImpl) ListComponents(input v1.ListComponentsInput) (v1.ListComponentsOutput, error)
- func (v *MaelServiceImpl) ListEventSources(input v1.ListEventSourcesInput) (v1.ListEventSourcesOutput, error)
- func (v *MaelServiceImpl) ListProjects(input v1.ListProjectsInput) (v1.ListProjectsOutput, error)
- func (v *MaelServiceImpl) NotifyDataChanged(input v1.NotifyDataChangedInput) (v1.NotifyDataChangedOutput, error)
- func (v *MaelServiceImpl) PutComponent(input v1.PutComponentInput) (v1.PutComponentOutput, error)
- func (v *MaelServiceImpl) PutEventSource(input v1.PutEventSourceInput) (v1.PutEventSourceOutput, error)
- func (v *MaelServiceImpl) PutProject(input v1.PutProjectInput) (v1.PutProjectOutput, error)
- func (v *MaelServiceImpl) RemoveComponent(input v1.RemoveComponentInput) (v1.RemoveComponentOutput, error)
- func (v *MaelServiceImpl) RemoveEventSource(input v1.RemoveEventSourceInput) (v1.RemoveEventSourceOutput, error)
- func (v *MaelServiceImpl) RemoveProject(input v1.RemoveProjectInput) (v1.RemoveProjectOutput, error)
- func (v *MaelServiceImpl) ToggleEventSources(input v1.ToggleEventSourcesInput) (v1.ToggleEventSourcesOutput, error)
- type NodeServiceImpl
- func (n *NodeServiceImpl) Cluster() *Cluster
- func (n *NodeServiceImpl) GetConvergeRegistry() *converge.Registry
- func (n *NodeServiceImpl) GetStatus(input v1.GetNodeStatusInput) (v1.GetNodeStatusOutput, error)
- func (n *NodeServiceImpl) ListNodeStatus(input v1.ListNodeStatusInput) (v1.ListNodeStatusOutput, error)
- func (n *NodeServiceImpl) LogPairs() []interface{}
- func (n *NodeServiceImpl) NodeId() string
- func (n *NodeServiceImpl) OnClusterUpdated(nodes map[string]v1.NodeStatus)
- func (n *NodeServiceImpl) OnContainersChanged()
- func (n *NodeServiceImpl) PlaceComponent(input v1.PlaceComponentInput) (v1.PlaceComponentOutput, error)
- func (n *NodeServiceImpl) RunAutoscaleLoop(interval time.Duration, ctx context.Context, wg *sync.WaitGroup)
- func (n *NodeServiceImpl) RunAwsAutoScaleTerminatePollerLoop(queueUrl string, maxAgeSeconds int, ctx context.Context, wg *sync.WaitGroup)
- func (n *NodeServiceImpl) RunAwsSpotTerminatePollerLoop(interval time.Duration, ctx context.Context, wg *sync.WaitGroup)
- func (n *NodeServiceImpl) RunNodeStatusLoop(interval time.Duration, ctx context.Context, wg *sync.WaitGroup)
- func (n *NodeServiceImpl) StartStopComponents(input v1.StartStopComponentsInput) (v1.StartStopComponentsOutput, error)
- func (n *NodeServiceImpl) StatusChanged(input v1.StatusChangedInput) (v1.StatusChangedOutput, error)
- func (n NodeServiceImpl) TerminateNode(input v1.TerminateNodeInput) (v1.TerminateNodeOutput, error)
- func (n *NodeServiceImpl) TryPlaceComponent(componentName string)
- type NodeStatusByEmptyThenLoadAvg
- type NodeStatusByStartedAt
- type PlacementOption
- func BestStartComponentOption(placementByNode map[string]*PlacementOption, componentName string, ...) *PlacementOption
- func BestStopComponentOption(placementByNode map[string]*PlacementOption, componentName string) *PlacementOption
- func CalcAutoscalePlacement(nodes []v1.NodeStatus, componentsByName map[string]v1.Component) []*PlacementOption
- type PlacementOptionByCostDesc
- type PlacementOptionByNode
- type ProjectDiff
- type PullState
- type ShutdownFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PutProjectOutputEmpty ¶
func PutProjectOutputEmpty(out v1.PutProjectOutput) bool
Types ¶
type AwsLifecycleHookMessage ¶
type AwsLifecycleHookMessage struct { QueueUrl string MessageReceiptHandle string AccountId string RequestId string Time string Service string AutoScalingGroupName string EC2InstanceId string LifecycleActionToken string LifecycleHookName string }
func (*AwsLifecycleHookMessage) ToAwsLifecycleHook ¶
func (h *AwsLifecycleHookMessage) ToAwsLifecycleHook() *v1.AwsLifecycleHook
func (*AwsLifecycleHookMessage) TryParseAge ¶
func (h *AwsLifecycleHookMessage) TryParseAge() *time.Duration
type AwsSpotInstanceAction ¶
type CalcAutoscaleInput ¶
type CalcAutoscaleInput struct { Nodes []v1.NodeStatus ComponentsByName map[string]v1.Component }
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func NewCluster ¶
func NewCluster(myNodeId string, localNodeService v1.NodeService) *Cluster
func (*Cluster) AddObserver ¶
func (c *Cluster) AddObserver(observer ClusterObserver)
func (*Cluster) BroadcastDataChanged ¶
func (c *Cluster) BroadcastDataChanged(input v1.NotifyDataChangedInput)
func (*Cluster) BroadcastTerminationEvent ¶
func (c *Cluster) BroadcastTerminationEvent(input v1.TerminateNodeInput)
func (*Cluster) GetMaelstromService ¶
func (c *Cluster) GetMaelstromService(node v1.NodeStatus) v1.MaelstromService
func (*Cluster) GetMaelstromServiceWithTimeout ¶
func (c *Cluster) GetMaelstromServiceWithTimeout(node v1.NodeStatus, timeout time.Duration) v1.MaelstromService
func (*Cluster) GetNodeById ¶
func (c *Cluster) GetNodeById(nodeId string) *v1.NodeStatus
func (*Cluster) GetNodeService ¶
func (c *Cluster) GetNodeService(node v1.NodeStatus) v1.NodeService
func (*Cluster) GetNodeServiceById ¶
func (c *Cluster) GetNodeServiceById(nodeId string) v1.NodeService
func (*Cluster) GetNodeServiceWithTimeout ¶
func (c *Cluster) GetNodeServiceWithTimeout(node v1.NodeStatus, timeout time.Duration) v1.NodeService
func (*Cluster) GetNodes ¶
func (c *Cluster) GetNodes() []v1.NodeStatus
func (*Cluster) GetRemoteMaelstromServices ¶
func (c *Cluster) GetRemoteMaelstromServices() []v1.MaelstromService
func (*Cluster) GetRemoteNodeServices ¶
func (c *Cluster) GetRemoteNodeServices() []v1.NodeService
func (*Cluster) RemoveAndBroadcast ¶
func (c *Cluster) RemoveAndBroadcast()
func (*Cluster) RemoveNode ¶
func (*Cluster) SetAllNodes ¶
func (c *Cluster) SetAllNodes(nodes []v1.NodeStatus)
func (*Cluster) SetAndBroadcastStatus ¶
func (c *Cluster) SetAndBroadcastStatus(node v1.NodeStatus)
func (*Cluster) SetLocalMaelstromService ¶
func (c *Cluster) SetLocalMaelstromService(svc v1.MaelstromService)
type ClusterObserver ¶
type ClusterObserver interface {
OnClusterUpdated(nodes map[string]v1.NodeStatus)
}
type ComponentInfoByRunningCountAndReqTime ¶
type ComponentInfoByRunningCountAndReqTime struct { Components []v1.ComponentInfo InstanceCounts map[string]int }
func (ComponentInfoByRunningCountAndReqTime) Len ¶
func (s ComponentInfoByRunningCountAndReqTime) Len() int
func (ComponentInfoByRunningCountAndReqTime) Less ¶
func (s ComponentInfoByRunningCountAndReqTime) Less(i, j int) bool
func (ComponentInfoByRunningCountAndReqTime) Swap ¶
func (s ComponentInfoByRunningCountAndReqTime) Swap(i, j int)
type ComponentResolver ¶
type ComponentSubscriber ¶
type ComponentSubscriber interface {
OnComponentNotification(change v1.DataChangedUnion)
}
type ComponentTargetByCompName ¶
type ComponentTargetByCompName []v1.ComponentTarget
func (ComponentTargetByCompName) Len ¶
func (s ComponentTargetByCompName) Len() int
func (ComponentTargetByCompName) Less ¶
func (s ComponentTargetByCompName) Less(i, j int) bool
func (ComponentTargetByCompName) Swap ¶
func (s ComponentTargetByCompName) Swap(i, j int)
type DbComponentResolver ¶
type DbComponentResolver struct {
// contains filtered or unexported fields
}
func NewDbResolver ¶
func NewDbResolver(db db.Db, certWrapper *cert.CertMagicWrapper, cacheDuration time.Duration) *DbComponentResolver
func (*DbComponentResolver) ByHTTPRequest ¶
func (*DbComponentResolver) ByName ¶
func (r *DbComponentResolver) ByName(componentName string) (comp v1.Component, err error)
func (*DbComponentResolver) OnComponentNotification ¶
func (r *DbComponentResolver) OnComponentNotification(cn v1.DataChangedUnion)
type DockerPruner ¶
type DockerPruner struct {
// contains filtered or unexported fields
}
func NewDockerPruner ¶
type DurationAscend ¶
func (DurationAscend) Len ¶
func (s DurationAscend) Len() int
func (DurationAscend) Less ¶
func (s DurationAscend) Less(i, j int) bool
func (DurationAscend) Swap ¶
func (s DurationAscend) Swap(i, j int)
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func NewGateway ¶
type ImagePuller ¶
type ImagePuller struct {
// contains filtered or unexported fields
}
func NewImagePuller ¶
func (*ImagePuller) OnComponentNotification ¶
func (i *ImagePuller) OnComponentNotification(change v1.DataChangedUnion)
type LogsHandler ¶
type LogsHandler struct {
// contains filtered or unexported fields
}
func NewLogsHandler ¶
func NewLogsHandler(dockerClient *docker.Client) *LogsHandler
func (*LogsHandler) ServeHTTP ¶
func (h *LogsHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type MaelServiceImpl ¶
type MaelServiceImpl struct {
// contains filtered or unexported fields
}
func NewMaelServiceImpl ¶
func NewMaelServiceImpl(db db.Db, componentSubscribers []ComponentSubscriber, certWrapper *cert.CertMagicWrapper, myNodeId string, cluster *Cluster) *MaelServiceImpl
func (*MaelServiceImpl) GetComponent ¶
func (v *MaelServiceImpl) GetComponent(input v1.GetComponentInput) (v1.GetComponentOutput, error)
func (*MaelServiceImpl) GetEventSource ¶
func (v *MaelServiceImpl) GetEventSource(input v1.GetEventSourceInput) (v1.GetEventSourceOutput, error)
func (*MaelServiceImpl) GetProject ¶
func (v *MaelServiceImpl) GetProject(input v1.GetProjectInput) (v1.GetProjectOutput, error)
func (*MaelServiceImpl) ListComponents ¶
func (v *MaelServiceImpl) ListComponents(input v1.ListComponentsInput) (v1.ListComponentsOutput, error)
func (*MaelServiceImpl) ListEventSources ¶
func (v *MaelServiceImpl) ListEventSources(input v1.ListEventSourcesInput) (v1.ListEventSourcesOutput, error)
func (*MaelServiceImpl) ListProjects ¶
func (v *MaelServiceImpl) ListProjects(input v1.ListProjectsInput) (v1.ListProjectsOutput, error)
func (*MaelServiceImpl) NotifyDataChanged ¶
func (v *MaelServiceImpl) NotifyDataChanged(input v1.NotifyDataChangedInput) (v1.NotifyDataChangedOutput, error)
func (*MaelServiceImpl) PutComponent ¶
func (v *MaelServiceImpl) PutComponent(input v1.PutComponentInput) (v1.PutComponentOutput, error)
func (*MaelServiceImpl) PutEventSource ¶
func (v *MaelServiceImpl) PutEventSource(input v1.PutEventSourceInput) (v1.PutEventSourceOutput, error)
func (*MaelServiceImpl) PutProject ¶
func (v *MaelServiceImpl) PutProject(input v1.PutProjectInput) (v1.PutProjectOutput, error)
func (*MaelServiceImpl) RemoveComponent ¶
func (v *MaelServiceImpl) RemoveComponent(input v1.RemoveComponentInput) (v1.RemoveComponentOutput, error)
func (*MaelServiceImpl) RemoveEventSource ¶
func (v *MaelServiceImpl) RemoveEventSource(input v1.RemoveEventSourceInput) (v1.RemoveEventSourceOutput, error)
func (*MaelServiceImpl) RemoveProject ¶
func (v *MaelServiceImpl) RemoveProject(input v1.RemoveProjectInput) (v1.RemoveProjectOutput, error)
func (*MaelServiceImpl) ToggleEventSources ¶
func (v *MaelServiceImpl) ToggleEventSources(input v1.ToggleEventSourcesInput) (v1.ToggleEventSourcesOutput, error)
type NodeServiceImpl ¶
type NodeServiceImpl struct { // if node.observedAt is older than this duration we'll consider it stale and remove it NodeLiveness time.Duration // contains filtered or unexported fields }
func (*NodeServiceImpl) Cluster ¶
func (n *NodeServiceImpl) Cluster() *Cluster
func (*NodeServiceImpl) GetConvergeRegistry ¶
func (n *NodeServiceImpl) GetConvergeRegistry() *converge.Registry
func (*NodeServiceImpl) GetStatus ¶
func (n *NodeServiceImpl) GetStatus(input v1.GetNodeStatusInput) (v1.GetNodeStatusOutput, error)
func (*NodeServiceImpl) ListNodeStatus ¶
func (n *NodeServiceImpl) ListNodeStatus(input v1.ListNodeStatusInput) (v1.ListNodeStatusOutput, error)
func (*NodeServiceImpl) LogPairs ¶
func (n *NodeServiceImpl) LogPairs() []interface{}
func (*NodeServiceImpl) NodeId ¶
func (n *NodeServiceImpl) NodeId() string
func (*NodeServiceImpl) OnClusterUpdated ¶
func (n *NodeServiceImpl) OnClusterUpdated(nodes map[string]v1.NodeStatus)
func (*NodeServiceImpl) OnContainersChanged ¶
func (n *NodeServiceImpl) OnContainersChanged()
func (*NodeServiceImpl) PlaceComponent ¶
func (n *NodeServiceImpl) PlaceComponent(input v1.PlaceComponentInput) (v1.PlaceComponentOutput, error)
func (*NodeServiceImpl) RunAutoscaleLoop ¶
func (*NodeServiceImpl) RunAwsAutoScaleTerminatePollerLoop ¶
func (*NodeServiceImpl) RunAwsSpotTerminatePollerLoop ¶
func (*NodeServiceImpl) RunNodeStatusLoop ¶
func (*NodeServiceImpl) StartStopComponents ¶
func (n *NodeServiceImpl) StartStopComponents(input v1.StartStopComponentsInput) (v1.StartStopComponentsOutput, error)
func (*NodeServiceImpl) StatusChanged ¶
func (n *NodeServiceImpl) StatusChanged(input v1.StatusChangedInput) (v1.StatusChangedOutput, error)
func (NodeServiceImpl) TerminateNode ¶
func (n NodeServiceImpl) TerminateNode(input v1.TerminateNodeInput) (v1.TerminateNodeOutput, error)
func (*NodeServiceImpl) TryPlaceComponent ¶
func (n *NodeServiceImpl) TryPlaceComponent(componentName string)
type NodeStatusByEmptyThenLoadAvg ¶
type NodeStatusByEmptyThenLoadAvg []v1.NodeStatus
func (NodeStatusByEmptyThenLoadAvg) Len ¶
func (s NodeStatusByEmptyThenLoadAvg) Len() int
func (NodeStatusByEmptyThenLoadAvg) Less ¶
func (s NodeStatusByEmptyThenLoadAvg) Less(i, j int) bool
func (NodeStatusByEmptyThenLoadAvg) Swap ¶
func (s NodeStatusByEmptyThenLoadAvg) Swap(i, j int)
type NodeStatusByStartedAt ¶
type NodeStatusByStartedAt []v1.NodeStatus
func (NodeStatusByStartedAt) Len ¶
func (s NodeStatusByStartedAt) Len() int
func (NodeStatusByStartedAt) Less ¶
func (s NodeStatusByStartedAt) Less(i, j int) bool
func (NodeStatusByStartedAt) Swap ¶
func (s NodeStatusByStartedAt) Swap(i, j int)
type PlacementOption ¶
type PlacementOption struct { TargetNode *v1.NodeStatus Input *v1.StartStopComponentsInput }
func BestStartComponentOption ¶
func BestStartComponentOption(placementByNode map[string]*PlacementOption, componentName string, requiredMemoryMiB int64, maxInstPerNode int64, displaceOK bool) *PlacementOption
func BestStopComponentOption ¶
func BestStopComponentOption(placementByNode map[string]*PlacementOption, componentName string) *PlacementOption
func CalcAutoscalePlacement ¶
func CalcAutoscalePlacement(nodes []v1.NodeStatus, componentsByName map[string]v1.Component) []*PlacementOption
func (*PlacementOption) ContainerCountByComponent ¶
func (p *PlacementOption) ContainerCountByComponent() (byComp map[string]int, total int)
func (*PlacementOption) RamUsed ¶
func (p *PlacementOption) RamUsed() int64
type PlacementOptionByCostDesc ¶
type PlacementOptionByCostDesc struct { Options []*PlacementOption ComponentName string }
func (PlacementOptionByCostDesc) Len ¶
func (s PlacementOptionByCostDesc) Len() int
func (PlacementOptionByCostDesc) Less ¶
func (s PlacementOptionByCostDesc) Less(i, j int) bool
func (PlacementOptionByCostDesc) Swap ¶
func (s PlacementOptionByCostDesc) Swap(i, j int)
type PlacementOptionByNode ¶
type PlacementOptionByNode []*PlacementOption
func (PlacementOptionByNode) Len ¶
func (s PlacementOptionByNode) Len() int
func (PlacementOptionByNode) Less ¶
func (s PlacementOptionByNode) Less(i, j int) bool
func (PlacementOptionByNode) Swap ¶
func (s PlacementOptionByNode) Swap(i, j int)
type ProjectDiff ¶
type ProjectDiff struct { ComponentPut []v1.Component ComponentRemove []string EventSourcePut []v1.EventSource EventSourceRemove []string }
func DiffProject ¶
func DiffProject(oldProject v1.Project, newProject v1.Project) ProjectDiff
type PullState ¶
type PullState struct {
// contains filtered or unexported fields
}
func NewPullState ¶
type ShutdownFunc ¶
type ShutdownFunc func()
Click to show internal directories.
Click to hide internal directories.