quota

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package quota implements the `gplay quota` command family.

Quota tracking is derived from the audit log: every gplay invocation that made an API call is one tick against Google Play's documented quota windows (daily and per-minute). Limits match the publicly documented values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QuotaCommand

func QuotaCommand() *ffcli.Command

QuotaCommand builds the root `gplay quota` command.

Types

type CommandCount

type CommandCount struct {
	Command string `json:"command"`
	Count   int    `json:"count"`
}

CommandCount is a single bucket in the top-commands breakdown.

type Status

type Status struct {
	DailyCount     int            `json:"daily_count"`
	DailyLimit     int            `json:"daily_limit"`
	DailyRatio     float64        `json:"daily_ratio"`
	DailyWarning   bool           `json:"daily_warning"`
	MinuteCount    int            `json:"minute_count"`
	MinuteLimit    int            `json:"minute_limit"`
	MinuteRatio    float64        `json:"minute_ratio"`
	MinuteWarning  bool           `json:"minute_warning"`
	WindowStart    time.Time      `json:"window_start"`
	WindowEnd      time.Time      `json:"window_end"`
	TopCommands    []CommandCount `json:"top_commands,omitempty"`
	AuditDisabled  bool           `json:"audit_disabled,omitempty"`
	AuditLogPath   string         `json:"audit_log_path,omitempty"`
	TotalEntries   int            `json:"total_entries"`
	ErrorRateRatio float64        `json:"error_rate_ratio"`
}

Status is the computed quota view returned by `quota status`.

func Compute

func Compute(entries []audit.Entry, now time.Time, topN int) Status

Compute aggregates entries into a quota Status relative to `now`. Exported so other packages (tests) can reuse the math.

Jump to

Keyboard shortcuts

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