Documentation
¶
Index ¶
- type Checkpoint
- type CheckpointKey
- type CheckpointStore
- func (s *CheckpointStore) Delete(key CheckpointKey)
- func (s *CheckpointStore) Get(key CheckpointKey) (Checkpoint, bool)
- func (s *CheckpointStore) Set(key CheckpointKey, cp Checkpoint)
- func (s *CheckpointStore) Shutdown(ctx context.Context) error
- func (s *CheckpointStore) ShutdownTimeout(timeout time.Duration) error
- type ConnectionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
Checkpoint holds the durable state for a single polling pair.
type CheckpointKey ¶
CheckpointKey identifies a unique polling pair.
type CheckpointStore ¶
type CheckpointStore struct {
// contains filtered or unexported fields
}
CheckpointStore persists polling checkpoints to disk so a runner restart doesn't replay the entire Events API window. Writes are debounced: the in-memory map is the canonical state, and a timer-driven flush writes it to disk at most once per flushDebounce interval.
func NewCheckpointStore ¶
func NewCheckpointStore() (*CheckpointStore, error)
NewCheckpointStore creates a CheckpointStore, loading any existing checkpoint file from ~/.config/plan42-runner.checkpoint.json. A missing file is treated as empty. An unparseable file is logged and treated as empty.
func (*CheckpointStore) Delete ¶
func (s *CheckpointStore) Delete(key CheckpointKey)
Delete removes the checkpoint for the given key and marks the store dirty.
func (*CheckpointStore) Get ¶
func (s *CheckpointStore) Get(key CheckpointKey) (Checkpoint, bool)
Get returns the checkpoint for the given key.
func (*CheckpointStore) Set ¶
func (s *CheckpointStore) Set(key CheckpointKey, cp Checkpoint)
Set updates the checkpoint for the given key and marks the store dirty.
func (*CheckpointStore) Shutdown ¶
func (s *CheckpointStore) Shutdown(ctx context.Context) error
Shutdown stops the checkpoint store: cancels the watch goroutine, waits for any in-flight timer-scheduled flush, and runs a synchronous final flush.
func (*CheckpointStore) ShutdownTimeout ¶
func (s *CheckpointStore) ShutdownTimeout(timeout time.Duration) error
ShutdownTimeout calls Shutdown with a timeout-bounded context.
type ConnectionInfo ¶
ConnectionInfo carries the connection details needed to construct a GitHub client for polling a (GithubConnectionID, OrgName) pair.