gitstore

package
v0.0.0-...-8ab4013 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Overview

Package gitstore stores gomodfs modules in a git repository.

git's storage backend has the nice property that it does de-duping even if your filesystem doesn't. We don't store commits in git-- only trees and blobs. And then refs to trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Stats   *stats.Stats // or nil if stats are not enabled
	GitRepo string
	// contains filtered or unexported fields
}

func (*Storage) CachedModules

func (s *Storage) CachedModules(ctx context.Context) ([]store.ModuleVersion, error)

func (*Storage) CheckExists

func (d *Storage) CheckExists() error

CheckExists checks that the git repo named in d.GitRepo actually exists.

func (*Storage) GetFile

func (s *Storage) GetFile(ctx context.Context, h store.ModHandle, path string) ([]byte, error)

func (*Storage) GetInfoFile

func (s *Storage) GetInfoFile(ctx context.Context, mv store.ModuleVersion) (_ []byte, err error)

func (*Storage) GetModFile

func (s *Storage) GetModFile(ctx context.Context, mv store.ModuleVersion) (_ []byte, err error)

func (*Storage) GetZipHash

func (s *Storage) GetZipHash(ctx context.Context, h store.ModHandle) ([]byte, error)

func (*Storage) GetZipRoot

func (s *Storage) GetZipRoot(ctx context.Context, mv store.ModuleVersion) (store.ModHandle, error)

func (*Storage) PutInfoFile

func (s *Storage) PutInfoFile(ctx context.Context, mv store.ModuleVersion, data []byte) (err error)

func (*Storage) PutModFile

func (s *Storage) PutModFile(ctx context.Context, mv store.ModuleVersion, data []byte) (err error)

func (*Storage) PutModule

func (*Storage) Readdir

func (s *Storage) Readdir(ctx context.Context, h store.ModHandle, path string) ([]store.Dirent, error)

func (*Storage) Stat

func (s *Storage) Stat(ctx context.Context, h store.ModHandle, modPath string) (fs.FileInfo, error)

Jump to

Keyboard shortcuts

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