bcgit

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func DefaultVolumeSpec

func DefaultVolumeSpec() blobcache.VolumeSpec

func FmtURL

func FmtURL(u blobcache.URL) string

FmtURL formats a URL

func Hash

func Hash(x []byte) blobcache.CID

func NewRemoteHelper

func NewRemoteHelper(rem *Remote) gitrh.Server

func SaveRoot

func SaveRoot(ctx context.Context, svr bcsdk.Saver, root Root) error

func SyncGit

func SyncGit(ctx context.Context, src bcsdk.RO, dst bcsdk.WO, id blobcache.CID) error

SyncGit copies the transitive closure of the git object `id` from src to dst.

Types

type GitRef

type GitRef = gitrh.Ref

type RefIterator

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

func (*RefIterator) Close

func (ri *RefIterator) Close() error

func (*RefIterator) Next

func (ri *RefIterator) Next(ctx context.Context, dst *GitRef) error

type Remote

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

Remote is a Git Remote backed by a Blobcache Volume

func NewRemote

func NewRemote(svc blobcache.Service, volh blobcache.Handle) *Remote

func OpenRemoteHelper

func OpenRemoteHelper(ctx context.Context, bc blobcache.Service, u blobcache.URL) (*Remote, error)

func (*Remote) Close

func (rem *Remote) Close() error

func (*Remote) Fetch

func (rem *Remote) Fetch(ctx context.Context, ws bcsdk.WO, refs map[string]blobcache.CID, dst map[string]blobcache.CID) error

func (*Remote) GetRef

func (rem *Remote) GetRef(ctx context.Context, name string) (*GitRef, error)

func (*Remote) OpenIterator

func (rem *Remote) OpenIterator(ctx context.Context) (*RefIterator, error)

OpenIterator returns an iterator impelementing steams.Iterator If a non-nil RetIterator is returned (only happens when err == nil) then it is the callers responsibility to close it or the underlying transaction will remain open.

func (*Remote) Push

func (rem *Remote) Push(ctx context.Context, src bcsdk.RO, refs []GitRef) error

type Root

type Root struct {
	Refs tries.Root
}

Root is stored in the Volume's cell.

func LoadRoot

func LoadRoot(ctx context.Context, ldr bcsdk.Loader) (*Root, error)

func ParseRoot

func ParseRoot(data []byte) (*Root, error)

type Schema

type Schema struct {
	Tries tries.Machine
}

func (*Schema) Sync

func (sch *Schema) Sync(ctx context.Context, rs schema.RO, ws schema.WO, rootData []byte) error

func (*Schema) ValidateChange

func (sch *Schema) ValidateChange(ctx context.Context, ch schema.Change) error

Directories

Path Synopsis
package gitrh provides a Server implementation of the Git remote helper IPC protocol
package gitrh provides a Server implementation of the Git remote helper IPC protocol

Jump to

Keyboard shortcuts

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