Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
Version string
Capabilities Capabilities
Prerequisites Prerequisites
References References
}
Bundle represents a parsed git bundle
type Capabilities ¶
type Capabilities []Capability
"Capabilities", which are only in the v3 format, indicate functionality that the bundle requires to be read properly.
func (Capabilities) Append ¶
func (cc Capabilities) Append(b []byte) []byte
Append appends the capabilities to the given buffer
func (Capabilities) Bytes ¶
func (cc Capabilities) Bytes() []byte
Bytes returns the capabilities as a byte slice
func (Capabilities) Get ¶
func (cc Capabilities) Get(key string) (value []byte, ok bool)
Get returns the value of the given key in the capabilities
func (Capabilities) Has ¶
func (cc Capabilities) Has(key string) bool
Has returns true if the given key is present in the capabilities
func (Capabilities) String ¶
func (cc Capabilities) String() string
String implements the fmt.Stringer interface
type Capability ¶
capability = "@" key ["=" value] LF key = 1*(ALPHA / DIGIT / "-") value = *(%01-09 / %0b-FF)
func ParseCapability ¶
func ParseCapability(line []byte) (Capability, error)
ParseCapability parses a capability from a line of a bundle file
func (Capability) Append ¶
func (c Capability) Append(b []byte) []byte
Append appends the capability line to the given buffer
func (Capability) Bytes ¶
func (c Capability) Bytes() (line []byte)
Bytes returns the capability line as a byte slice
func (Capability) String ¶
func (c Capability) String() string
String implements the fmt.Stringer interface
type ObjectID ¶
type ObjectID string
obj-id = 40*(HEXDIGIT) HEXDIG = DIGIT / "a" / "b" / "c" / "d" / "e" / "f"
type Prerequisite ¶
prerequisite = "-" obj-id SP comment LF
func ParsePrerequisite ¶
func ParsePrerequisite(line []byte) (Prerequisite, error)
ParsePrerequisite parses a prerequisite from a line of a bundle file
func (Prerequisite) Append ¶
func (p Prerequisite) Append(b []byte) []byte
Append appends the prerequisite line to the given buffer
func (Prerequisite) Bytes ¶
func (p Prerequisite) Bytes() []byte
Bytes returns the prerequisite line as a byte slice
func (Prerequisite) String ¶
func (p Prerequisite) String() string
String implements the fmt.Stringer interface
type Prerequisites ¶
type Prerequisites []Prerequisite
"Prerequisites" lists the objects that are NOT included in the bundle and the reader of the bundle MUST already have, in order to use the data in the bundle.
func (Prerequisites) Append ¶
func (pp Prerequisites) Append(b []byte) []byte
Append appends the prerequisites to the given buffer
func (Prerequisites) Bytes ¶
func (pp Prerequisites) Bytes() []byte
Bytes returns the prerequisites as a byte slice
func (Prerequisites) Map ¶
func (pp Prerequisites) Map() map[ObjectID]string
Map converts the slice into a map by object id
func (Prerequisites) String ¶
func (pp Prerequisites) String() string
String implements the fmt.Stringer interface
type Reference ¶
reference = obj-id SP refname LF
func ParseReference ¶
ParseReference parses a reference from a line of a bundle file
type References ¶
type References []Reference
References is a list of references
func (References) Append ¶
func (rr References) Append(b []byte) []byte
Append appends the references to the given buffer
func (References) Bytes ¶
func (rr References) Bytes() []byte
Bytes returns the references as a byte slice
func (References) Map ¶
func (rr References) Map() map[string]ObjectID
Map converts the slice into a map by reference name
func (References) String ¶
func (rr References) String() string
String implements the fmt.Stringer interface