resets

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resets polls public trackers of announced global usage-limit resets: codex-resets.com for Codex and claude-resets.com for Claude.

Index

Constants

This section is empty.

Variables

View Source
var Claude = Feed{Name: "claude-resets", URL: "https://claude-resets.com/data/resets.json", /* contains filtered or unexported fields */}

Claude reads claude-resets.com's dataset of Claude resets announced by @ClaudeDevs and the Claude team. It has no schedule or forecast, so only Latest and Stats are filled.

View Source
var Codex = Feed{Name: "codex-resets", URL: "https://codex-resets.com/api/v1/status", /* contains filtered or unexported fields */}

Functions

This section is empty.

Types

type Feed

type Feed struct {
	Name string
	URL  string
	// contains filtered or unexported fields
}

Feed is one tracker: where to fetch it and how to read it into a Status.

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

func NewPoller

func NewPoller(client *http.Client, feed Feed, settings func() Settings) *Poller

func (*Poller) Refresh

func (p *Poller) Refresh()

Refresh asks the poll loop to fetch now.

func (*Poller) Run

func (p *Poller) Run(ctx context.Context)

func (*Poller) Snapshot

func (p *Poller) Snapshot() Snapshot

type Reset

type Reset struct {
	ID          string     `json:"id"`
	Status      string     `json:"status,omitempty"`
	ResetType   string     `json:"reset_type"`
	AnnouncedAt time.Time  `json:"announced_at"`
	ScheduledAt *time.Time `json:"scheduled_for,omitempty"`
	Text        string     `json:"text"`
	Source      Source     `json:"source"`
	// Scope is who it applied to, e.g. "Max" (Claude).
	Scope string `json:"scope,omitempty"`
	// UsableUntil is when a banked reset expires (Claude).
	UsableUntil *time.Time `json:"usable_until,omitempty"`
}

type Settings

type Settings struct {
	Enabled         bool `json:"enabled"`
	IntervalMinutes int  `json:"intervalMinutes"`
}

func DefaultSettings

func DefaultSettings() Settings

func (*Settings) Normalize

func (s *Settings) Normalize()

type Snapshot

type Snapshot struct {
	Status    *Status    `json:"status"`
	FetchedAt *time.Time `json:"fetchedAt"`
	Error     string     `json:"error,omitempty"`
}

Snapshot is the last successful fetch plus bookkeeping.

type Source

type Source struct {
	Type   string `json:"type"`
	Author string `json:"author,omitempty"`
	URL    string `json:"url,omitempty"`
}

type Stats

type Stats struct {
	Total           int        `json:"total"`
	LastResetAt     *time.Time `json:"last_reset_at"`
	DaysSinceLast   *float64   `json:"days_since_last"`
	AvgIntervalDays *float64   `json:"avg_interval_days"`
}

type Status

type Status struct {
	Latest    *Reset `json:"latest_reset"`
	Scheduled *Reset `json:"scheduled_reset"`
	Watch     *Watch `json:"active_watch"`
	Stats     Stats  `json:"stats"`
}

type Watch

type Watch struct {
	Level          string    `json:"level"`
	ChancePercent  *int      `json:"reset_chance_percent"`
	ForecastWindow string    `json:"forecast_window"`
	ObservedAt     time.Time `json:"observed_at"`
	ExpiresAt      time.Time `json:"expires_at"`
	Text           string    `json:"text"`
	Source         Source    `json:"source"`
}

Jump to

Keyboard shortcuts

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