artifactcache

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 18 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package artifactcache provides a cache handler for the runner.

Inspired by https://github.com/sp-ricard-valverde/github-act-cache-server

TODO: Authorization TODO: Restrictions for accessing a cache, see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache TODO: Force deleting cache entries, see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	ID        uint64 `json:"id" boltholdKey:"ID"`
	Key       string `json:"key" boltholdIndex:"Key"`
	Version   string `json:"version" boltholdIndex:"Version"`
	Size      int64  `json:"cacheSize"`
	Complete  bool   `json:"complete" boltholdIndex:"Complete"`
	UsedAt    int64  `json:"usedAt" boltholdIndex:"UsedAt"`
	CreatedAt int64  `json:"createdAt" boltholdIndex:"CreatedAt"`
}

type Handler

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

func StartHandler

func StartHandler(dir, outboundIP string, port uint16, logger logrus.FieldLogger) (*Handler, error)

func (*Handler) Close

func (h *Handler) Close() error

func (*Handler) ExternalURL

func (h *Handler) ExternalURL() string

type Request

type Request struct {
	Key     string `json:"key" `
	Version string `json:"version"`
	Size    int64  `json:"cacheSize"`
}

func (*Request) ToCache

func (c *Request) ToCache() *Cache

type Storage

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

func NewStorage

func NewStorage(rootDir string) (*Storage, error)

func (*Storage) Commit

func (s *Storage) Commit(id uint64, size int64) (int64, error)

func (*Storage) Exist

func (s *Storage) Exist(id uint64) (bool, error)

func (*Storage) Remove

func (s *Storage) Remove(id uint64)

func (*Storage) Serve

func (s *Storage) Serve(w http.ResponseWriter, r *http.Request, id uint64)

func (*Storage) Write

func (s *Storage) Write(id uint64, offset int64, reader io.Reader) error

Jump to

Keyboard shortcuts

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