Documentation
¶
Overview ¶
Package cache manages local cached team configs.
Index ¶
- type Cache
- func (c *Cache) CacheDir() string
- func (c *Cache) Clear(owner, repo string) error
- func (c *Cache) Exists(owner, repo string) bool
- func (c *Cache) GetMetadata(owner, repo string) (*Metadata, error)
- func (c *Cache) ListCached() ([]string, error)
- func (c *Cache) Read(owner, repo string) (content string, meta *Metadata, err error)
- func (c *Cache) Write(owner, repo, content string, meta *Metadata) error
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache manages local cached team configs.
func (*Cache) Clear ¶
Clear removes cached content for a repo. Returns nil even if files don't exist (idempotent operation).
func (*Cache) GetMetadata ¶
GetMetadata returns only the metadata without reading content.
func (*Cache) ListCached ¶
ListCached returns all cached repo identifiers.
type Metadata ¶
type Metadata struct {
Owner string `json:"owner"`
Repo string `json:"repo"`
ETag string `json:"etag,omitempty"`
SHA string `json:"sha,omitempty"`
LastFetched time.Time `json:"last_fetched"`
}
Metadata stores cache state for conditional fetching.
func (*Metadata) RepoString ¶
RepoString returns "owner/repo" format.
Click to show internal directories.
Click to hide internal directories.