Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseResetDuration ¶ added in v0.4.0
ParseResetDuration parses an RFC3339 timestamp and returns the duration until that time.
Types ¶
type AuthError ¶ added in v0.7.0
AuthError indicates an authentication failure that persists after credential reload.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FetchUsage ¶
func (c *Client) FetchUsage(ctx context.Context) (*UsageResponse, error)
type RateLimitError ¶ added in v0.8.4
RateLimitError indicates a 429 response with an optional Retry-After duration.
func (*RateLimitError) Error ¶ added in v0.8.4
func (e *RateLimitError) Error() string
type UsageResponse ¶
type UsageResponse struct {
SessionPercent float64
WeeklyPercent float64
SessionResetAt string
WeeklyResetAt string
WeeklySonnetPct *float64
WeeklySonnetReset string
WeeklyOpusPct *float64
WeeklyOpusReset string
WeeklyDesignPct *float64
WeeklyDesignReset string
ExtraUsageEnabled bool
ExtraUsageLimit *float64
ExtraUsageUsed *float64
Raw json.RawMessage
}
UsageResponse represents the parsed OAuth usage data.
func (*UsageResponse) SessionResetDuration ¶
func (u *UsageResponse) SessionResetDuration() time.Duration
SessionResetDuration parses the session reset time and returns duration until reset.
func (*UsageResponse) WeeklyResetDuration ¶
func (u *UsageResponse) WeeklyResetDuration() time.Duration
WeeklyResetDuration parses the weekly reset time and returns duration until reset.
Click to show internal directories.
Click to hide internal directories.