application

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DraftAnnotation

func DraftAnnotation(snapshot *RepositorySnapshot, input AddInput) (store.Annotation, error)

func WarningFor

func WarningFor(status anchor.Status) string

WarningFor is the single stale-record warning policy for every surface.

Types

type AcknowledgeCommentInput

type AcknowledgeCommentInput struct {
	File         string
	Comment      string
	Body         string
	Author       store.Author
	Acknowledged bool
}

AcknowledgeCommentInput explicitly retains one exceptional inline comment.

type AddInput

type AddInput struct {
	File    string
	Excerpt string
	Kind    store.Kind
	Body    string
	Author  store.Author
	Policy  *store.Policy
}

AddInput is the complete intent needed to create an annotation.

type AnnotationView

type AnnotationView struct {
	Record      store.Annotation
	Status      anchor.Status
	Line        int
	Occurrences int
	Warning     string
}

AnnotationView is the common record and resolution presented by every reader.

type ConvertCommentInput

type ConvertCommentInput struct {
	File    string
	Comment string
	Kind    store.Kind
	Author  store.Author
}

ConvertCommentInput records explanatory comment intent before removing it.

type FileSnapshot

type FileSnapshot struct {
	Path        string
	Content     []byte
	Exists      bool
	Annotations []AnnotationView
}

FileSnapshot contains source and resolved annotations from the same read.

type Mutation

type Mutation struct {
	Record   store.Annotation
	Path     string
	Warnings []string
}

Mutation is the durable record and its repository-relative path.

type ReanchorInput

type ReanchorInput struct {
	ID      string
	File    string
	Excerpt string
}

ReanchorInput moves an existing annotation without changing its identity.

type RepositoryIdentity

type RepositoryIdentity struct {
	ID            string
	Name          string
	CloneURL      string
	DefaultBranch string
}

RepositoryIdentity is stable presentation metadata for a snapshot.

type RepositorySnapshot

type RepositorySnapshot struct {
	Repository  RepositoryIdentity
	Commit      string
	Dirty       bool
	GeneratedAt time.Time
	Files       []FileSnapshot
}

RepositorySnapshot is one internally consistent read of a repository.

func AssembleSnapshot

func AssembleSnapshot(input SnapshotInput) (*RepositorySnapshot, error)

AssembleSnapshot resolves a complete source revision without performing I/O.

func BuildSnapshot

func BuildSnapshot(entry repository.Repository) (*RepositorySnapshot, error)

BuildSnapshot reads every annotation and annotated source file once.

func (*RepositorySnapshot) Counts

func (s *RepositorySnapshot) Counts() map[anchor.Status]int

Counts returns resolution counts for the repository.

func (*RepositorySnapshot) File

func (s *RepositorySnapshot) File(path string) (FileSnapshot, bool)

File returns one annotated file from the snapshot.

func (*RepositorySnapshot) Search

func (s *RepositorySnapshot) Search(query string) []AnnotationView

Search returns annotations whose record fields contain the query.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service owns local repository reads and mutations.

func NewService

func NewService(entry repository.Repository) *Service

NewService constructs the application service for one repository.

func (*Service) AcknowledgeComment

func (s *Service) AcknowledgeComment(input AcknowledgeCommentInput) (Mutation, error)

AcknowledgeComment creates the exact policy record required to retain a comment.

func (*Service) Add

func (s *Service) Add(input AddInput) (Mutation, error)

Add creates one fully validated annotation record.

func (*Service) CheckComments

func (s *Service) CheckComments(requested []string) ([]commentpolicy.Violation, error)

CheckComments applies the configured repository policy.

func (*Service) ConvertComment

func (s *Service) ConvertComment(input ConvertCommentInput) (Mutation, error)

ConvertComment durably records rationale before editing the source.

func (*Service) Reanchor

func (s *Service) Reanchor(input ReanchorInput) (Mutation, error)

Reanchor changes only an annotation's target.

func (*Service) Snapshot

func (s *Service) Snapshot() (*RepositorySnapshot, error)

Snapshot reads the repository through the shared snapshot contract.

type SnapshotInput

type SnapshotInput struct {
	Repository  RepositoryIdentity
	Commit      string
	Dirty       bool
	GeneratedAt time.Time
	Records     []store.Annotation
	Sources     map[string][]byte
}

SnapshotInput is a complete repository read from one source revision.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL