Documentation
¶
Index ¶
- type Annotation
- type Store
- func (s *Store) Add(a Annotation)
- func (s *Store) All() map[string][]Annotation
- func (s *Store) Count() int
- func (s *Store) Delete(file string, line int, changeType string) bool
- func (s *Store) Files() []string
- func (s *Store) FormatOutput() string
- func (s *Store) Get(file string) []Annotation
- func (s *Store) Has(file string, line int, changeType string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct {
File string // file path relative to repo root
Line int // line number in the diff
Type string // change type: "+", "-", or " "
Comment string // user comment text
}
Annotation represents a user comment on a specific diff line.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds annotations in memory, keyed by filename.
func (*Store) Add ¶
func (s *Store) Add(a Annotation)
Add adds an annotation for the given file and line. If an annotation already exists at the same file:line, it is replaced.
func (*Store) All ¶
func (s *Store) All() map[string][]Annotation
All returns all annotations grouped by file. The returned map is a copy.
func (*Store) Delete ¶
Delete removes the annotation at the given file, line and change type. Returns true if an annotation was found and removed.
func (*Store) FormatOutput ¶
FormatOutput produces the structured output format for stdout. Files are sorted alphabetically, annotations within each file by line number. Returns empty string if no annotations exist.
func (*Store) Get ¶
func (s *Store) Get(file string) []Annotation
Get returns all annotations for the given file, sorted by line number.