Documentation
¶
Overview ¶
Package textproto implements low-level details of the fast-import format.
This package deals with abstracting over special-case commands that break the "line-based" nature of the format (the "data" command, responses to the "cat-blob" command).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatBlobReader ¶
type CatBlobReader struct {
// contains filtered or unexported fields
}
CatBlobReader is a low-level parser of an fast-import auxiliary "cat-blob" stream.
func NewCatBlobReader ¶
func NewCatBlobReader(r io.Reader) *CatBlobReader
NewCatBlobReader creates a new CatBlobReader parser.
func (*CatBlobReader) ReadLine ¶
func (cbr *CatBlobReader) ReadLine() (line string, err error)
ReadLine reads a response from the stream; with special handling for responses to "cat-blob" commands, which contain multiple newline characters.
type CatBlobWriter ¶
type CatBlobWriter struct {
// contains filtered or unexported fields
}
CatBlobWriter is a low-level marshaller for an auxiliary cat-blob stream.
func NewCatBlobWriter ¶
func NewCatBlobWriter(w io.Writer) *CatBlobWriter
NewCatBlobWriter creates a new CatBlobWriter marshaller.
func (*CatBlobWriter) WriteBlob ¶
func (cbw *CatBlobWriter) WriteBlob(sha1 string, data string) error
WriteBlob writes a response to a "cat-blob" command to the stream.
func (*CatBlobWriter) WriteLine ¶
func (cbw *CatBlobWriter) WriteLine(a ...interface{}) error
WriteLine writes a response (to a command OTHER THAN "cat-blob") to the stream; arguments are handled similarly to fmt.Println.
Use WriteBlob instead to write responses to "cat-blob" commands.
type FIReader ¶
type FIReader struct {
// contains filtered or unexported fields
}
FIReader is a low-level parser of a fast-import stream.
func NewFIReader ¶
NewFIReader creates a new FIReader parser.