githubevents

package
v1.0.49 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	LastEventID      string
	ETag             string
	PollIntervalSecs int
}

Checkpoint holds the durable state for a single polling pair.

type CheckpointKey

type CheckpointKey struct {
	GithubConnectionID string
	OrgName            string
}

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

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

type ConnectionInfo struct {
	Token   string
	BaseURL string
	User    string
}

ConnectionInfo carries the connection details needed to construct a GitHub client for polling a (GithubConnectionID, OrgName) pair.

Jump to

Keyboard shortcuts

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