Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultBranch = "gh-aw-dispatch-work-coordinator"
View Source
const FileName = "dispatch-work-coordinator.jsonl"
Variables ¶
This section is empty.
Functions ¶
func Serialize ¶
func Serialize(transactions []Transaction) ([]byte, error)
Types ¶
type Branch ¶
Branch operates through GitHub Git APIs without a local checkout or Git executable.
func (Branch) Update ¶
func (b Branch) Update(ctx context.Context, change func([]Transaction) ([]Transaction, bool, error)) ([]Transaction, bool, error)
Update retries rejected non-force reference updates from a fresh branch snapshot.
type ClaimState ¶
type Projection ¶
func Replay ¶
func Replay(transactions []Transaction) (Projection, error)
type Transaction ¶
type Transaction struct {
Kind string `json:"kind"`
WorkID string `json:"work_id"`
Work json.RawMessage `json:"work,omitempty"`
ClaimID string `json:"claim_id,omitempty"`
RunID string `json:"run_id,omitempty"`
AttemptID string `json:"attempt_id,omitempty"`
Outcome string `json:"outcome,omitempty"`
}
func Apply ¶
func Apply(transactions []Transaction, tx Transaction) ([]Transaction, bool, error)
func Compact ¶
func Compact(transactions []Transaction) ([]Transaction, error)
func Parse ¶
func Parse(data []byte) ([]Transaction, error)
type WorkState ¶
type WorkState struct {
WorkID string `json:"work_id"`
Work json.RawMessage `json:"work"`
State string `json:"state"`
Winner string `json:"winner,omitempty"`
Claims []ClaimState `json:"claims"`
Outcome string `json:"outcome,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.