cache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cache is a self-hosted GitHub Actions cache server implementing the v2 (twirp/JSON) CacheService protocol, so actions/cache stores blobs on this host instead of round-tripping to GitHub's Azure backend. The protocol and storage behavior are ported from falcondev-oss/github-actions-cache-server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunnerEnv

func RunnerEnv(advertiseURL string) map[string]string

RunnerEnv returns the environment variables to inject into each runner container so actions/cache (v2) targets this self-hosted server instead of GitHub's Azure backend. advertiseURL must be reachable from inside the container (e.g. http://host.docker.internal:3000).

Types

type Server

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

Server is the running cache HTTP server.

func New

func New(ctx context.Context, cfg config.Cache, logger *slog.Logger) (*Server, error)

New builds the cache server and opens its store.

func (*Server) AdvertiseURL

func (s *Server) AdvertiseURL() string

AdvertiseURL is the base URL runners should use to reach this cache.

func (*Server) RedactedAdvertiseURL

func (s *Server) RedactedAdvertiseURL() string

RedactedAdvertiseURL is safe to log.

func (*Server) SetGitBundler

func (s *Server) SetGitBundler(repoSlug string, f func(ctx context.Context, repoSlug string, w io.Writer) error)

SetGitBundler enables the dotgit-cache endpoint for one configured repository: GET /gitmirror/{owner}/{repo} streams a git bundle of that repo's host mirror.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start runs the server until ctx is cancelled, then shuts it down gracefully.

Jump to

Keyboard shortcuts

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