stats

package
v16.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseReferenceDiscovery

func ParseReferenceDiscovery(body io.Reader, cb ReferenceCb) error

ParseReferenceDiscovery parses a client's reference discovery stream and calls cb with references. It returns an error in case it couldn't make sense of the client's request.

Expected protocol: - "# service=git-upload-pack\n" - FLUSH - "<OID> <ref>\x00<capabilities>\n" - "<OID> <ref>\n" - ... - FLUSH

Types

type Reference

type Reference struct {
	// Oid is the object ID the reference points to
	Oid []byte
	// Name of the reference. The name will be suffixed with ^{} in case
	// the reference is the peeled commit.
	Name []byte
}

Reference as used by the reference discovery protocol.

type ReferenceCb

type ReferenceCb func(Reference) bool

ReferenceCb is a callback that consumes parsed references. WARNING: It must not hold onto the byte slices as the backing array is reused! Make copies if needed. Returns true if reference parsing should stop.

Jump to

Keyboard shortcuts

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