41 lines
923 B
Go
41 lines
923 B
Go
package work
|
|
|
|
import "time"
|
|
|
|
type AgentLeaseID string
|
|
type AgentFencingToken uint64
|
|
type AgentLeaseState string
|
|
|
|
const (
|
|
AgentLeaseActive AgentLeaseState = "ACTIVE"
|
|
AgentLeaseExpired AgentLeaseState = "EXPIRED"
|
|
)
|
|
|
|
type AgentLease struct {
|
|
ID AgentLeaseID
|
|
RunID AgentRunID
|
|
WorkerID string
|
|
FencingToken AgentFencingToken
|
|
State AgentLeaseState
|
|
AcquiredAt time.Time
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
type AgentCallbackKind string
|
|
|
|
const (
|
|
AgentCallbackHeartbeat AgentCallbackKind = "HEARTBEAT"
|
|
AgentCallbackCheckpoint AgentCallbackKind = "CHECKPOINT"
|
|
AgentCallbackResult AgentCallbackKind = "RESULT"
|
|
AgentCallbackCancelAcknowledged AgentCallbackKind = "CANCEL_ACKNOWLEDGED"
|
|
)
|
|
|
|
type AgentCallback struct {
|
|
RunID AgentRunID
|
|
WorkerID string
|
|
FencingToken AgentFencingToken
|
|
Sequence uint64
|
|
Kind AgentCallbackKind
|
|
ObservedAt time.Time
|
|
}
|