Documentation
¶
Overview ¶
Package ulreq implements encoding and decoding upload-request messages from a git-upload-pack command.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder reads and decodes AdvRef values from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
Will not read more data from r than necessary.
func (*Decoder) Decode ¶
Decode reads the next upload-request form its input and stores it in the value pointed to by v.
Example ¶
Output: capabilities = ofs-delta sysref=HEAD:/refs/heads/master wants = [1111111111111111111111111111111111111111 2222222222222222222222222222222222222222 3333333333333333333333333333333333333333] shallows = [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] depth = 2015-01-02 03:04:05 +0000 UTC
type Depth ¶
type Depth interface {
// contains filtered or unexported methods
}
Depth values stores the desired depth of the requested packfile: see DepthCommit, DepthSince and DepthReference.
type DepthCommits ¶
type DepthCommits int
DepthCommits values stores the maximum number of requested commits in the packfile. Zero means infinite. A negative value will have undefined consecuences.
type DepthReference ¶
type DepthReference string
DepthReference requests only commits not to found in the specified reference.
type DepthSince ¶
DepthSince values requests only commits newer than the specified time.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder writes UlReq values to an output stream.
func NewEncoder ¶
NewEncoder returns a new encoder that writes to w.
func (*Encoder) Encode ¶
Encode writes the UlReq encoding of v to the stream.
All the payloads will end with a newline character. Wants and shallows are sorted alphabetically. A depth of 0 means no depth request is sent.
Example ¶
Output: 005bwant 1111111111111111111111111111111111111111 ofs-delta sysref=HEAD:/refs/heads/master 0032want 2222222222222222222222222222222222222222 0032want 3333333333333333333333333333333333333333 0035shallow aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0035shallow bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 001cdeepen-since 1420167845 0000