gitremotego

package
v0.0.0-...-2092a18 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdList  = "list"
	CmdPush  = "push"
	CmdFetch = "fetch"
)

Variables

View Source
var DefaultCapabilities = strings.Join([]string{CmdPush, CmdFetch}, "\n")

Functions

func CidFromHex

func CidFromHex(sha string) (cid.Cid, error)

func GetLocalDir

func GetLocalDir() (string, error)

func HexFromCid

func HexFromCid(cid cid.Cid) (string, error)

Types

type Protocol

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

func NewProtocol

func NewProtocol(prefix string, handler ProtocolHandler) (*Protocol, error)

func (*Protocol) Printf

func (p *Protocol) Printf(w io.Writer, format string, a ...interface{}) (n int, err error)

func (*Protocol) Run

func (p *Protocol) Run(r io.Reader, w io.Writer) (err error)

type ProtocolHandler

type ProtocolHandler interface {
	Initialize(tracker *core.Tracker, repo *git.Repository) error
	Capabilities() string
	List(forPush bool) ([]string, error)
	Push(localRef string, remoteRef string) (string, error)
	ProvideBlock(identifier string, tracker *core.Tracker) ([]byte, error)
	Finish() error
}

Jump to

Keyboard shortcuts

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