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 ¶
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.
Click to show internal directories.
Click to hide internal directories.