Help us shape the future of Go! Take the 2026 Go Developer Survey

cricsheet

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 13 Imported by: 0

README

Cricsheet Archive Notes

Scoreline caches Cricsheet JSON under the Scoreline cache directory and indexes the extracted match files locally. Archive browsing does not call CricketData.org and therefore does not spend live API quota.

The refresh command downloads:

https://cricsheet.org/downloads/all_json.zip

This archive is currently about 100 MB, so the TUI only refreshes it when the user explicitly presses r inside Cricket Archives. Normal archive entry only scans the local cache and applies the user's format/team/competition/recent-day filters.

Documentation

Overview

Package cricsheet handles Cricsheet archive data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveFilter

type ArchiveFilter struct {
	Formats      []string
	Teams        []string
	Competitions []string
	RecentDays   int
	Limit        int
}

ArchiveFilter filters locally indexed Cricsheet matches.

type Client

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

Client reads and indexes local Cricsheet JSON files.

func NewClient

func NewClient() (*Client, error)

NewClient creates a Cricsheet archive client using Scoreline's cache path.

func (*Client) CacheDir

func (c *Client) CacheDir() string

CacheDir returns the local Cricsheet cache directory.

func (*Client) Details

func (c *Client) Details(matchID string) (*cricket.MatchDetails, error)

Details reads a cached Cricsheet JSON match and maps it into a detail model.

func (*Client) IndexLocal

func (c *Client) IndexLocal() ([]cricket.Match, error)

IndexLocal scans cached JSON files and returns lightweight match entries.

func (*Client) IndexLocalFiltered

func (c *Client) IndexLocalFiltered(filter ArchiveFilter) ([]cricket.Match, error)

IndexLocalFiltered scans cached JSON files and returns filtered match entries.

func (*Client) RefreshAllJSON

func (c *Client) RefreshAllJSON(ctx context.Context) error

RefreshAllJSON downloads and extracts the official Cricsheet JSON archive.

Jump to

Keyboard shortcuts

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