Help us shape the future of Go! Take the 2026 Go Developer Survey

guardedpush

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marker

func Marker(attempt string) string

Marker correlates fresh screen evidence with this one attempt, not its send receipt.

Types

type Engine

type Engine struct {
	Now     func() time.Time
	Sleep   func(context.Context, time.Duration) error
	Observe func(context.Context) (Frame, error)
	Clear   func(context.Context, string) error
	Submit  func(context.Context, string) error
	Locked  func(string, func(func() bool) Result) Result
}

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, q Request, o Options) Result

Run performs at most one clear and one submission, under an own-attempt lock. Observe must freshly validate authoritative metadata and return a stable terminal/session identity. Clear and Submit must be single calls without transport retry. Frames are private in-memory data.

type Frame

type Frame struct {
	Identity, Family, Draft, Screen string
	State                           State
	Empty                           bool
}

type Options

type Options struct{ Wait, DraftWait, Stable, Confirm, Poll time.Duration }

func Defaults

func Defaults() Options

func (Options) Validate

func (o Options) Validate() bool

Validate bounds both fake-clock work and real calls. No CLI override weakens stability.

type Outcome

type Outcome string
const (
	Sent          Outcome = "sent"
	SentWithDraft Outcome = "sent-with-draft"
	HeldBusy      Outcome = "held-busy"
	HeldUnknown   Outcome = "held-unknown"
	Unconfirmed   Outcome = "unconfirmed"
)

type Request

type Request struct {
	Sender, Message, Attempt string
	Seq                      int
}

type Result

type Result struct {
	Outcome       Outcome `json:"outcome"`
	Phase         string  `json:"phase"`
	Reason        string  `json:"reason"`
	DraftIncluded bool    `json:"draftIncluded"`
}

type State

type State int
const (
	Unknown State = iota
	Idle
	Busy
)

Jump to

Keyboard shortcuts

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