Versions in this module Expand all Collapse all v0 v0.5.0 Oct 9, 2018 Changes in this version + var ErrBadFileHeader = errors.New("bad file header") + var ErrExtendedHeadersEOF = errors.New("expected file header while reading extended headers, got EOF") + var ErrIntOverflowDiff = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthDiff = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrNoFileHeader = errors.New("expected file header, got EOF") + var ErrNoHunkHeader = errors.New("no hunk header") + func PrintFileDiff(d *FileDiff) ([]byte, error) + func PrintHunks(hunks []*Hunk) ([]byte, error) + func PrintMultiFileDiff(ds []*FileDiff) ([]byte, error) + type ErrBadHunkHeader struct + func (e *ErrBadHunkHeader) Error() string + type ErrBadHunkLine struct + Line []byte + func (e *ErrBadHunkLine) Error() string + type FileDiff struct + Extended []string + Hunks []*Hunk + NewName string + NewTime *pbtypes.Timestamp + OrigName string + OrigTime *pbtypes.Timestamp + func ParseFileDiff(diff []byte) (*FileDiff, error) + func ParseMultiFileDiff(diff []byte) ([]*FileDiff, error) + func (*FileDiff) ProtoMessage() + func (d *FileDiff) Stat() Stat + func (m *FileDiff) Marshal() (data []byte, err error) + func (m *FileDiff) MarshalTo(data []byte) (int, error) + func (m *FileDiff) Reset() + func (m *FileDiff) Size() (n int) + func (m *FileDiff) String() string + func (m *FileDiff) Unmarshal(data []byte) error + type FileDiffReader struct + func NewFileDiffReader(r io.Reader) *FileDiffReader + func (r *FileDiffReader) HunksReader() *HunksReader + func (r *FileDiffReader) Read() (*FileDiff, error) + func (r *FileDiffReader) ReadAllHeaders() (*FileDiff, error) + func (r *FileDiffReader) ReadExtendedHeaders() ([]string, error) + func (r *FileDiffReader) ReadFileHeaders() (origName, newName string, origTimestamp, newTimestamp *time.Time, err error) + type Hunk struct + Body []byte + NewLines int32 + NewStartLine int32 + OrigLines int32 + OrigNoNewlineAt int32 + OrigStartLine int32 + Section string + StartPosition int32 + func ParseHunks(diff []byte) ([]*Hunk, error) + func (*Hunk) ProtoMessage() + func (h *Hunk) Stat() Stat + func (m *Hunk) Marshal() (data []byte, err error) + func (m *Hunk) MarshalTo(data []byte) (int, error) + func (m *Hunk) Reset() + func (m *Hunk) Size() (n int) + func (m *Hunk) String() string + func (m *Hunk) Unmarshal(data []byte) error + type HunksReader struct + func NewHunksReader(r io.Reader) *HunksReader + func (r *HunksReader) ReadAllHunks() ([]*Hunk, error) + func (r *HunksReader) ReadHunk() (*Hunk, error) + type MultiFileDiffReader struct + func NewMultiFileDiffReader(r io.Reader) *MultiFileDiffReader + func (r *MultiFileDiffReader) ReadAllFiles() ([]*FileDiff, error) + func (r *MultiFileDiffReader) ReadFile() (*FileDiff, error) + type OverflowError string + func (e OverflowError) Error() string + type ParseError struct + Err error + Line int + Offset int64 + func (e *ParseError) Error() string + type Stat struct + Added int32 + Changed int32 + Deleted int32 + func (*Stat) ProtoMessage() + func (m *Stat) Marshal() (data []byte, err error) + func (m *Stat) MarshalTo(data []byte) (int, error) + func (m *Stat) Reset() + func (m *Stat) Size() (n int) + func (m *Stat) String() string + func (m *Stat) Unmarshal(data []byte) error