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

cache

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cache stores the canonical org JSON on disk and treats it as a 24h cache that is also hand-editable between runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir() string

DefaultDir is ${TMPDIR:-/tmp}/gh-org-view.

Types

type Cache

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

Cache resolves and reads/writes <org>-org.json under a directory.

func New

func New(dir string) *Cache

New returns a Cache rooted at dir.

func (*Cache) Dir

func (c *Cache) Dir() string

func (*Cache) IsFresh

func (c *Cache) IsFresh(org string) bool

IsFresh reports whether the cache file exists and is at most 24h old.

func (*Cache) Path

func (c *Cache) Path(org string) string

func (*Cache) Read

func (c *Cache) Read(org string) (*github.Org, error)

Read loads the cached org.

func (*Cache) Write

func (c *Cache) Write(org string, o *github.Org) error

Write atomically persists the org (temp file + rename).

Jump to

Keyboard shortcuts

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