Documentation ¶
Index ¶
- func Guid() string
- type App
- func (a *App) CrashCountAtIndex(instanceIndex int, currentTime time.Time) CrashCount
- func (a *App) EvacuatingInstancesAtIndex(index int) (instances []InstanceHeartbeat)
- func (a *App) ExtraStartingOrRunningInstances() (extras []InstanceHeartbeat)
- func (a *App) HasCrashedInstanceAtIndex(index int) bool
- func (a *App) HasEvacuatingInstanceAtIndex(index int) bool
- func (a *App) HasRunningInstanceAtIndex(index int) bool
- func (a *App) HasStartingInstanceAtIndex(index int) bool
- func (a *App) HasStartingOrRunningInstanceAtIndex(index int) bool
- func (a *App) HasStartingOrRunningInstances() bool
- func (a *App) HeartbeatsByIndex() (heartbeatsByIndex map[int][]InstanceHeartbeat)
- func (a *App) InstanceHeartbeatsAtIndex(index int) (heartbeats []InstanceHeartbeat)
- func (a *App) InstanceWithGuid(instanceGuid string) InstanceHeartbeat
- func (a *App) IsDesired() bool
- func (a *App) IsIndexDesired(index int) bool
- func (a *App) IsStaged() bool
- func (a *App) LogDescription() lager.Data
- func (a *App) MarshalJSON() ([]byte, error)
- func (a *App) NumberOfCrashedIndices() (count int)
- func (a *App) NumberOfCrashedInstances() (count int)
- func (a *App) NumberOfDesiredIndicesReporting() (count int)
- func (a *App) NumberOfDesiredIndicesWithAStartingOrRunningInstance() (count int)
- func (a *App) NumberOfDesiredInstances() int
- func (a *App) NumberOfStartingOrRunningInstances() (count int)
- func (a *App) StartingOrRunningInstancesAtIndex(index int) (instances []InstanceHeartbeat)
- func (a *App) ToJSON() []byte
- type AppPackageState
- type AppQueue
- type AppState
- type BasicAuthInfo
- type CrashCount
- type DesiredAppState
- type DropletExited
- type DropletExitedReason
- type DropletUpdatedMessage
- type FreshnessTimestamp
- type Heartbeat
- type InstanceHeartbeat
- func (instance InstanceHeartbeat) IsCrashed() bool
- func (instance InstanceHeartbeat) IsEvacuating() bool
- func (instance InstanceHeartbeat) IsRunning() bool
- func (instance InstanceHeartbeat) IsStarting() bool
- func (instance InstanceHeartbeat) IsStartingOrRunning() bool
- func (instance InstanceHeartbeat) LogDescription() lager.Data
- func (instance InstanceHeartbeat) StoreKey() string
- func (instance InstanceHeartbeat) ToCSV() []byte
- func (instance InstanceHeartbeat) ToJSON() []byte
- type InstanceState
- type PendingMessage
- type PendingStartMessage
- type PendingStartMessageReason
- type PendingStopMessage
- type PendingStopMessageReason
- type StartMessage
- type StopMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { AppGuid string AppVersion string Desired DesiredAppState InstanceHeartbeats []InstanceHeartbeat CrashCounts map[int]CrashCount // contains filtered or unexported fields }
func NewApp ¶
func NewApp(appGuid string, appVersion string, desired DesiredAppState, instanceHeartbeats []InstanceHeartbeat, crashCounts map[int]CrashCount) *App
func (*App) CrashCountAtIndex ¶
func (a *App) CrashCountAtIndex(instanceIndex int, currentTime time.Time) CrashCount
func (*App) EvacuatingInstancesAtIndex ¶
func (a *App) EvacuatingInstancesAtIndex(index int) (instances []InstanceHeartbeat)
func (*App) ExtraStartingOrRunningInstances ¶
func (a *App) ExtraStartingOrRunningInstances() (extras []InstanceHeartbeat)
func (*App) HasCrashedInstanceAtIndex ¶
func (*App) HasEvacuatingInstanceAtIndex ¶
func (*App) HasRunningInstanceAtIndex ¶
func (*App) HasStartingInstanceAtIndex ¶
func (*App) HasStartingOrRunningInstanceAtIndex ¶
func (*App) HasStartingOrRunningInstances ¶
func (*App) HeartbeatsByIndex ¶
func (a *App) HeartbeatsByIndex() (heartbeatsByIndex map[int][]InstanceHeartbeat)
func (*App) InstanceHeartbeatsAtIndex ¶
func (a *App) InstanceHeartbeatsAtIndex(index int) (heartbeats []InstanceHeartbeat)
func (*App) InstanceWithGuid ¶
func (a *App) InstanceWithGuid(instanceGuid string) InstanceHeartbeat
func (*App) IsIndexDesired ¶
func (*App) LogDescription ¶
func (*App) MarshalJSON ¶
func (*App) NumberOfCrashedIndices ¶
func (*App) NumberOfCrashedInstances ¶
func (*App) NumberOfDesiredIndicesReporting ¶
func (*App) NumberOfDesiredInstances ¶
func (*App) NumberOfStartingOrRunningInstances ¶
func (*App) StartingOrRunningInstancesAtIndex ¶
func (a *App) StartingOrRunningInstancesAtIndex(index int) (instances []InstanceHeartbeat)
type AppPackageState ¶
type AppPackageState string
const ( AppPackageStateInvalid AppPackageState = "" AppPackageStateFailed AppPackageState = "FAILED" AppPackageStatePending AppPackageState = "PENDING" AppPackageStateStaged AppPackageState = "STAGED" )
type AppQueue ¶
type AppQueue struct { DesiredApps chan map[string]DesiredAppState DoneAnalyzing chan struct{} // contains filtered or unexported fields }
func NewAppQueue ¶
func NewAppQueue() *AppQueue
func (*AppQueue) FetchDesiredAppsSuccess ¶
func (*AppQueue) SetFetchDesiredAppsSuccess ¶
type BasicAuthInfo ¶
func DecodeBasicAuthInfo ¶
func DecodeBasicAuthInfo(encoded string) (BasicAuthInfo, error)
func (BasicAuthInfo) Encode ¶
func (info BasicAuthInfo) Encode() string
type CrashCount ¶
type CrashCount struct { AppGuid string `json:"droplet"` AppVersion string `json:"version"` InstanceIndex int `json:"instance_index"` CrashCount int `json:"crash_count"` CreatedAt int64 `json:"created_at"` }
func NewCrashCountFromJSON ¶
func NewCrashCountFromJSON(encoded []byte) (CrashCount, error)
func (CrashCount) StoreKey ¶
func (crashCount CrashCount) StoreKey() string
func (CrashCount) ToJSON ¶
func (crashCount CrashCount) ToJSON() []byte
type DesiredAppState ¶
type DesiredAppState struct { AppGuid string `json:"id"` AppVersion string `json:"version"` NumberOfInstances int `json:"instances"` State AppState `json:"state"` PackageState AppPackageState `json:"package_state"` }
func NewDesiredAppStateFromCSV ¶
func NewDesiredAppStateFromCSV(appGuid, appVersion string, encoded []byte) (DesiredAppState, error)
func NewDesiredAppStateFromJSON ¶
func NewDesiredAppStateFromJSON(encoded []byte) (DesiredAppState, error)
func (DesiredAppState) Equal ¶
func (state DesiredAppState) Equal(other DesiredAppState) bool
func (DesiredAppState) LogDescription ¶
func (state DesiredAppState) LogDescription() lager.Data
func (DesiredAppState) StoreKey ¶
func (state DesiredAppState) StoreKey() string
func (DesiredAppState) ToCSV ¶
func (state DesiredAppState) ToCSV() []byte
func (DesiredAppState) ToJSON ¶
func (state DesiredAppState) ToJSON() []byte
type DropletExited ¶
type DropletExited struct { CCPartition string `json:"cc_partition"` AppGuid string `json:"droplet"` AppVersion string `json:"version"` InstanceGuid string `json:"instance"` InstanceIndex int `json:"index"` Reason DropletExitedReason `json:"reason"` ExitStatusCode int `json:"exit_status"` ExitDescription string `json:"exit_description"` CrashTimestamp int64 `json:"crash_timestamp,omitempty"` }
func NewDropletExitedFromJSON ¶
func NewDropletExitedFromJSON(encoded []byte) (DropletExited, error)
func (DropletExited) LogDescription ¶
func (dropletExited DropletExited) LogDescription() lager.Data
func (DropletExited) ToJSON ¶
func (dropletExited DropletExited) ToJSON() []byte
type DropletExitedReason ¶
type DropletExitedReason string
const ( DropletExitedReasonInvalid DropletExitedReason = "" DropletExitedReasonStopped DropletExitedReason = "STOPPED" DropletExitedReasonCrashed DropletExitedReason = "CRASHED" DropletExitedReasonDEAShutdown DropletExitedReason = "DEA_SHUTDOWN" DropletExitedReasonDEAEvacuation DropletExitedReason = "DEA_EVACUATION" )
type DropletUpdatedMessage ¶
type DropletUpdatedMessage struct {
AppGuid string `json:"droplet"`
}
type FreshnessTimestamp ¶
type FreshnessTimestamp struct {
Timestamp int64 `json:"timestamp"`
}
type Heartbeat ¶
type Heartbeat struct { DeaGuid string `json:"dea"` InstanceHeartbeats []InstanceHeartbeat `json:"droplets"` }
func NewHeartbeatFromJSON ¶
func (*Heartbeat) LogDescription ¶
type InstanceHeartbeat ¶
type InstanceHeartbeat struct { AppGuid string `json:"droplet"` AppVersion string `json:"version"` InstanceGuid string `json:"instance"` InstanceIndex int `json:"index"` State InstanceState `json:"state"` StateTimestamp float64 `json:"state_timestamp"` DeaGuid string `json:"dea_guid"` }
func NewInstanceHeartbeatFromCSV ¶
func NewInstanceHeartbeatFromCSV(appGuid, appVersion, instanceGuid string, encoded []byte) (InstanceHeartbeat, error)
func NewInstanceHeartbeatFromJSON ¶
func NewInstanceHeartbeatFromJSON(encoded []byte) (InstanceHeartbeat, error)
func (InstanceHeartbeat) IsCrashed ¶
func (instance InstanceHeartbeat) IsCrashed() bool
func (InstanceHeartbeat) IsEvacuating ¶
func (instance InstanceHeartbeat) IsEvacuating() bool
func (InstanceHeartbeat) IsRunning ¶
func (instance InstanceHeartbeat) IsRunning() bool
func (InstanceHeartbeat) IsStarting ¶
func (instance InstanceHeartbeat) IsStarting() bool
func (InstanceHeartbeat) IsStartingOrRunning ¶
func (instance InstanceHeartbeat) IsStartingOrRunning() bool
func (InstanceHeartbeat) LogDescription ¶
func (instance InstanceHeartbeat) LogDescription() lager.Data
func (InstanceHeartbeat) StoreKey ¶
func (instance InstanceHeartbeat) StoreKey() string
func (InstanceHeartbeat) ToCSV ¶
func (instance InstanceHeartbeat) ToCSV() []byte
func (InstanceHeartbeat) ToJSON ¶
func (instance InstanceHeartbeat) ToJSON() []byte
type InstanceState ¶
type InstanceState string
const ( InstanceStateInvalid InstanceState = "" InstanceStateStarting InstanceState = "STARTING" InstanceStateRunning InstanceState = "RUNNING" InstanceStateCrashed InstanceState = "CRASHED" InstanceStateEvacuating InstanceState = "EVACUATING" )
type PendingMessage ¶
type PendingMessage struct { MessageId string `json:"message_id"` SendOn int64 `json:"send_on"` SentOn int64 `json:"sent_on"` KeepAlive int `json:"keep_alive"` AppGuid string `json:"droplet"` AppVersion string `json:"version"` }
func (PendingMessage) HasBeenSent ¶
func (message PendingMessage) HasBeenSent() bool
func (PendingMessage) IsExpired ¶
func (message PendingMessage) IsExpired(currentTime time.Time) bool
func (PendingMessage) IsTimeToSend ¶
func (message PendingMessage) IsTimeToSend(currentTime time.Time) bool
type PendingStartMessage ¶
type PendingStartMessage struct { PendingMessage IndexToStart int `json:"index"` Priority float64 `json:"priority"` SkipVerification bool `json:"skip_verification"` //This only exists to allow the evacuator to specify that a message *must* be sent, regardless of verification status StartReason PendingStartMessageReason `json:"start_reason"` }
func NewPendingStartMessage ¶
func NewPendingStartMessage(now time.Time, delayInSeconds int, keepAliveInSeconds int, appGuid string, appVersion string, indexToStart int, priority float64, startReason PendingStartMessageReason) PendingStartMessage
func NewPendingStartMessageFromJSON ¶
func NewPendingStartMessageFromJSON(encoded []byte) (PendingStartMessage, error)
func SortStartMessagesByPriority ¶
func SortStartMessagesByPriority(messages []PendingStartMessage) []PendingStartMessage
func (PendingStartMessage) Equal ¶
func (message PendingStartMessage) Equal(another PendingStartMessage) bool
func (PendingStartMessage) LogDescription ¶
func (message PendingStartMessage) LogDescription() lager.Data
func (PendingStartMessage) StoreKey ¶
func (message PendingStartMessage) StoreKey() string
func (PendingStartMessage) ToJSON ¶
func (message PendingStartMessage) ToJSON() []byte
type PendingStartMessageReason ¶
type PendingStartMessageReason string
const ( PendingStartMessageReasonInvalid PendingStartMessageReason = "" PendingStartMessageReasonCrashed PendingStartMessageReason = "CRASHED" PendingStartMessageReasonMissing PendingStartMessageReason = "MISSING" PendingStartMessageReasonEvacuating PendingStartMessageReason = "EVACUATING" )
type PendingStopMessage ¶
type PendingStopMessage struct { PendingMessage InstanceGuid string `json:"instance"` StopReason PendingStopMessageReason `json:"stop_reason"` }
func NewPendingStopMessage ¶
func NewPendingStopMessage(now time.Time, delayInSeconds int, keepAliveInSeconds int, appGuid string, appVersion string, instanceGuid string, stopReason PendingStopMessageReason) PendingStopMessage
func NewPendingStopMessageFromJSON ¶
func NewPendingStopMessageFromJSON(encoded []byte) (PendingStopMessage, error)
func (PendingStopMessage) Equal ¶
func (message PendingStopMessage) Equal(another PendingStopMessage) bool
func (PendingStopMessage) LogDescription ¶
func (message PendingStopMessage) LogDescription() lager.Data
func (PendingStopMessage) StoreKey ¶
func (message PendingStopMessage) StoreKey() string
func (PendingStopMessage) ToJSON ¶
func (message PendingStopMessage) ToJSON() []byte
type PendingStopMessageReason ¶
type PendingStopMessageReason string
const ( PendingStopMessageReasonInvalid PendingStopMessageReason = "" PendingStopMessageReasonExtra PendingStopMessageReason = "EXTRA" PendingStopMessageReasonDuplicate PendingStopMessageReason = "DUPLICATE" PendingStopMessageReasonEvacuationComplete PendingStopMessageReason = "EVACUATION_COMPLETE" )
type StartMessage ¶
type StartMessage struct { MessageId string `json:"message_id"` AppGuid string `json:"droplet"` AppVersion string `json:"version"` InstanceIndex int `json:"instance_index"` }
func NewStartMessageFromJSON ¶
func NewStartMessageFromJSON(encoded []byte) (StartMessage, error)
func (StartMessage) ToJSON ¶
func (message StartMessage) ToJSON() []byte
type StopMessage ¶
type StopMessage struct { MessageId string `json:"message_id"` AppGuid string `json:"droplet"` AppVersion string `json:"version"` InstanceGuid string `json:"instance_guid"` InstanceIndex int `json:"instance_index"` IsDuplicate bool `json:"is_duplicate"` }
func NewStopMessageFromJSON ¶
func NewStopMessageFromJSON(encoded []byte) (StopMessage, error)
func (StopMessage) ToJSON ¶
func (message StopMessage) ToJSON() []byte
Click to show internal directories.
Click to hide internal directories.