cache

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheResult

func CacheResult(org, team string, noOwner bool, repos []*github.Repository) error

cacheReposResult saves the repos result to cache

func CacheTeams

func CacheTeams(org string, teamNames []string) error

CacheTeams stores team names to the cache file, one per line. The file is stored as <cache_dir>/<org>/teams

func GetTeamsCachePath

func GetTeamsCachePath(org string) (string, error)

GetTeamsCachePath returns the path to the teams cache file for an org.

func LoadCachedTeams

func LoadCachedTeams(org string) ([]string, error)

LoadCachedTeams reads team names from the cache file. Returns nil, nil if the cache file doesn't exist.

Types

type CachedRepo

type CachedRepo struct {
	Name     string `json:"name"`
	HTMLURL  string `json:"html_url"`
	CloneURL string `json:"clone_url"`
}

type ReposResult

type ReposResult struct {
	Org       string        `json:"org"`
	Team      string        `json:"team,omitempty"`
	NoOwner   bool          `json:"noOwner,omitempty"`
	Repos     []*CachedRepo `json:"repos"`
	RunAt     string        `json:"runAt"`
	CachePath string        `json:"cachePath"`
}

ReposResult represents the cached result of a repos command run

func GetValidCache

func GetValidCache(org, team string, noOwner bool) *ReposResult

getValidCache returns the cached result if it matches the parameters and is less than 15 minutes old

Jump to

Keyboard shortcuts

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