Versions in this module Expand all Collapse all v0 v0.7.2 Mar 21, 2021 Changes in this version + var ErrBugNotExist = errors.New("bug doesn't exist") + func ChangeLabels(b Interface, author identity.Interface, unixTime int64, add, remove []string) ([]LabelChangeResult, *LabelChangeOperation, error) + func Create(author identity.Interface, unixTime int64, title, message string) (*Bug, *CreateOperation, error) + func CreateWithFiles(author identity.Interface, unixTime int64, title, message string, ...) (*Bug, *CreateOperation, error) + func Fetch(repo repository.Repo, remote string) (string, error) + func ListLocalIds(repo repository.Repo) ([]entity.Id, error) + func MergeAll(repo repository.ClockedRepo, remote string) <-chan entity.MergeResult + func NewErrMultipleMatchBug(matching []entity.Id) *entity.ErrMultipleMatch + func NewErrMultipleMatchOp(matching []entity.Id) *entity.ErrMultipleMatch + func Pull(repo repository.ClockedRepo, remote string) error + func Push(repo repository.Repo, remote string) (string, error) + func ReadAllLocalBugs(repo repository.ClockedRepo) <-chan StreamedBug + func ReadAllRemoteBugs(repo repository.ClockedRepo, remote string) <-chan StreamedBug + func Witnesser(repo repository.ClockedRepo) error + type AddCommentOperation struct + Files []git.Hash + Message string + func AddComment(b Interface, author identity.Interface, unixTime int64, message string) (*AddCommentOperation, error) + func AddCommentWithFiles(b Interface, author identity.Interface, unixTime int64, message string, ...) (*AddCommentOperation, error) + func NewAddCommentOp(author identity.Interface, unixTime int64, message string, files []git.Hash) *AddCommentOperation + func (op *AddCommentOperation) Apply(snapshot *Snapshot) + func (op *AddCommentOperation) GetFiles() []git.Hash + func (op *AddCommentOperation) Id() entity.Id + func (op *AddCommentOperation) IsAuthored() + func (op *AddCommentOperation) IsOperation() + func (op *AddCommentOperation) UnmarshalJSON(data []byte) error + func (op *AddCommentOperation) Validate() error + type AddCommentTimelineItem struct + func (a *AddCommentTimelineItem) IsAuthored() + type Bug struct + func FindLocalBug(repo repository.ClockedRepo, prefix string) (*Bug, error) + func NewBug() *Bug + func ReadLocalBug(repo repository.ClockedRepo, id entity.Id) (*Bug, error) + func ReadRemoteBug(repo repository.ClockedRepo, remote string, id string) (*Bug, error) + func (bug *Bug) Append(op Operation) + func (bug *Bug) Commit(repo repository.ClockedRepo) error + func (bug *Bug) CommitAsNeeded(repo repository.ClockedRepo) error + func (bug *Bug) Compile() Snapshot + func (bug *Bug) CreateLamportTime() lamport.Time + func (bug *Bug) EditLamportTime() lamport.Time + func (bug *Bug) EnsureIdentities(resolver identity.Resolver) error + func (bug *Bug) FirstOp() Operation + func (bug *Bug) Id() entity.Id + func (bug *Bug) LastOp() Operation + func (bug *Bug) Merge(repo repository.Repo, other Interface) (bool, error) + func (bug *Bug) NeedCommit() bool + func (bug *Bug) Validate() error + type BugsByCreationTime []*Bug + func (b BugsByCreationTime) Len() int + func (b BugsByCreationTime) Less(i, j int) bool + func (b BugsByCreationTime) Swap(i, j int) + type BugsByEditTime []*Bug + func (b BugsByEditTime) Len() int + func (b BugsByEditTime) Less(i, j int) bool + func (b BugsByEditTime) Swap(i, j int) + type Comment struct + Author identity.Interface + Files []git.Hash + Message string + UnixTime timestamp.Timestamp + func (c Comment) FormatTime() string + func (c Comment) FormatTimeRel() string + func (c Comment) Id() entity.Id + func (c Comment) IsAuthored() + type CommentHistoryStep struct + Author identity.Interface + Message string + UnixTime timestamp.Timestamp + type CommentTimelineItem struct + Author identity.Interface + CreatedAt timestamp.Timestamp + Files []git.Hash + History []CommentHistoryStep + LastEdit timestamp.Timestamp + Message string + func NewCommentTimelineItem(ID entity.Id, comment Comment) CommentTimelineItem + func (c *CommentTimelineItem) Append(comment Comment) + func (c *CommentTimelineItem) Edited() bool + func (c *CommentTimelineItem) Id() entity.Id + func (c *CommentTimelineItem) MessageIsEmpty() bool + type CreateOperation struct + Files []git.Hash + Message string + Title string + func NewCreateOp(author identity.Interface, unixTime int64, title, message string, ...) *CreateOperation + func (op *CreateOperation) Apply(snapshot *Snapshot) + func (op *CreateOperation) GetFiles() []git.Hash + func (op *CreateOperation) Id() entity.Id + func (op *CreateOperation) IsAuthored() + func (op *CreateOperation) IsOperation() + func (op *CreateOperation) UnmarshalJSON(data []byte) error + func (op *CreateOperation) Validate() error + type CreateTimelineItem struct + func (c *CreateTimelineItem) IsAuthored() + type EditCommentOperation struct + Files []git.Hash + Message string + Target entity.Id + func EditComment(b Interface, author identity.Interface, unixTime int64, target entity.Id, ...) (*EditCommentOperation, error) + func EditCommentWithFiles(b Interface, author identity.Interface, unixTime int64, target entity.Id, ...) (*EditCommentOperation, error) + func EditCreateComment(b Interface, author identity.Interface, unixTime int64, message string) (*EditCommentOperation, error) + func EditCreateCommentWithFiles(b Interface, author identity.Interface, unixTime int64, message string, ...) (*EditCommentOperation, error) + func NewEditCommentOp(author identity.Interface, unixTime int64, target entity.Id, message string, ...) *EditCommentOperation + func (op *EditCommentOperation) Apply(snapshot *Snapshot) + func (op *EditCommentOperation) GetFiles() []git.Hash + func (op *EditCommentOperation) Id() entity.Id + func (op *EditCommentOperation) IsAuthored() + func (op *EditCommentOperation) IsOperation() + func (op *EditCommentOperation) UnmarshalJSON(data []byte) error + func (op *EditCommentOperation) Validate() error + type Interface interface + Append func(op Operation) + Commit func(repo repository.ClockedRepo) error + Compile func() Snapshot + CreateLamportTime func() lamport.Time + EditLamportTime func() lamport.Time + FirstOp func() Operation + Id func() entity.Id + LastOp func() Operation + Merge func(repo repository.Repo, other Interface) (bool, error) + NeedCommit func() bool + Validate func() error + type Label string + func (l Label) Color() LabelColor + func (l Label) String() string + func (l Label) Validate() error + type LabelChangeOperation struct + Added []Label + Removed []Label + func ForceChangeLabels(b Interface, author identity.Interface, unixTime int64, add, remove []string) (*LabelChangeOperation, error) + func NewLabelChangeOperation(author identity.Interface, unixTime int64, added, removed []Label) *LabelChangeOperation + func (op *LabelChangeOperation) Apply(snapshot *Snapshot) + func (op *LabelChangeOperation) Id() entity.Id + func (op *LabelChangeOperation) IsAuthored() + func (op *LabelChangeOperation) IsOperation() + func (op *LabelChangeOperation) UnmarshalJSON(data []byte) error + func (op *LabelChangeOperation) Validate() error + type LabelChangeResult struct + Label Label + Status LabelChangeStatus + func (l LabelChangeResult) String() string + type LabelChangeStatus int + const LabelChangeAdded + const LabelChangeAlreadySet + const LabelChangeDoesntExist + const LabelChangeDuplicateInOp + const LabelChangeRemoved + type LabelChangeTimelineItem struct + Added []Label + Author identity.Interface + Removed []Label + UnixTime timestamp.Timestamp + func (l *LabelChangeTimelineItem) IsAuthored() + func (l LabelChangeTimelineItem) Id() entity.Id + type LabelColor color.RGBA + func (lc LabelColor) RGBA() color.RGBA + func (lc LabelColor) Term256() Term256 + type NoOpOperation struct + func NewNoOpOp(author identity.Interface, unixTime int64) *NoOpOperation + func NoOp(b Interface, author identity.Interface, unixTime int64, ...) (*NoOpOperation, error) + func (op *NoOpOperation) Apply(snapshot *Snapshot) + func (op *NoOpOperation) Id() entity.Id + func (op *NoOpOperation) IsAuthored() + func (op *NoOpOperation) IsOperation() + func (op *NoOpOperation) UnmarshalJSON(data []byte) error + func (op *NoOpOperation) Validate() error + type OpBase struct + Author identity.Interface + Metadata map[string]string + OperationType OperationType + UnixTime int64 + func (op *OpBase) AllMetadata() map[string]string + func (op *OpBase) GetAuthor() identity.Interface + func (op *OpBase) GetFiles() []git.Hash + func (op *OpBase) GetMetadata(key string) (string, bool) + func (op *OpBase) GetUnixTime() int64 + func (op *OpBase) SetMetadata(key string, value string) + func (op *OpBase) Time() time.Time + func (op *OpBase) UnmarshalJSON(data []byte) error + type Operation interface + AllMetadata func() map[string]string + Apply func(snapshot *Snapshot) + GetAuthor func() identity.Interface + GetFiles func() []git.Hash + GetMetadata func(key string) (string, bool) + GetUnixTime func() int64 + Id func() entity.Id + IsOperation func() + SetMetadata func(key string, value string) + Time func() time.Time + Validate func() error + type OperationIterator struct + func NewOperationIterator(bug Interface) *OperationIterator + func (it *OperationIterator) Next() bool + func (it *OperationIterator) Value() Operation + type OperationPack struct + Operations []Operation + func (opp *OperationPack) Append(op Operation) + func (opp *OperationPack) Clone() OperationPack + func (opp *OperationPack) IsEmpty() bool + func (opp *OperationPack) MarshalJSON() ([]byte, error) + func (opp *OperationPack) UnmarshalJSON(data []byte) error + func (opp *OperationPack) Validate() error + func (opp *OperationPack) Write(repo repository.ClockedRepo) (git.Hash, error) + type OperationType int + const AddCommentOp + const CreateOp + const EditCommentOp + const LabelChangeOp + const NoOpOp + const SetMetadataOp + const SetStatusOp + const SetTitleOp + type SetMetadataOperation struct + NewMetadata map[string]string + Target entity.Id + func NewSetMetadataOp(author identity.Interface, unixTime int64, target entity.Id, ...) *SetMetadataOperation + func SetMetadata(b Interface, author identity.Interface, unixTime int64, target entity.Id, ...) (*SetMetadataOperation, error) + func (op *SetMetadataOperation) Apply(snapshot *Snapshot) + func (op *SetMetadataOperation) Id() entity.Id + func (op *SetMetadataOperation) IsAuthored() + func (op *SetMetadataOperation) IsOperation() + func (op *SetMetadataOperation) UnmarshalJSON(data []byte) error + func (op *SetMetadataOperation) Validate() error + type SetStatusOperation struct + Status Status + func Close(b Interface, author identity.Interface, unixTime int64) (*SetStatusOperation, error) + func NewSetStatusOp(author identity.Interface, unixTime int64, status Status) *SetStatusOperation + func Open(b Interface, author identity.Interface, unixTime int64) (*SetStatusOperation, error) + func (op *SetStatusOperation) Apply(snapshot *Snapshot) + func (op *SetStatusOperation) Id() entity.Id + func (op *SetStatusOperation) IsAuthored() + func (op *SetStatusOperation) IsOperation() + func (op *SetStatusOperation) UnmarshalJSON(data []byte) error + func (op *SetStatusOperation) Validate() error + type SetStatusTimelineItem struct + Author identity.Interface + Status Status + UnixTime timestamp.Timestamp + func (s *SetStatusTimelineItem) IsAuthored() + func (s SetStatusTimelineItem) Id() entity.Id + type SetTitleOperation struct + Title string + Was string + func NewSetTitleOp(author identity.Interface, unixTime int64, title string, was string) *SetTitleOperation + func SetTitle(b Interface, author identity.Interface, unixTime int64, title string) (*SetTitleOperation, error) + func (op *SetTitleOperation) Apply(snapshot *Snapshot) + func (op *SetTitleOperation) Id() entity.Id + func (op *SetTitleOperation) IsAuthored() + func (op *SetTitleOperation) IsOperation() + func (op *SetTitleOperation) UnmarshalJSON(data []byte) error + func (op *SetTitleOperation) Validate() error + type SetTitleTimelineItem struct + Author identity.Interface + Title string + UnixTime timestamp.Timestamp + Was string + func (s *SetTitleTimelineItem) IsAuthored() + func (s SetTitleTimelineItem) Id() entity.Id + type Snapshot struct + Actors []identity.Interface + Author identity.Interface + Comments []Comment + CreatedAt time.Time + Labels []Label + Operations []Operation + Participants []identity.Interface + Status Status + Timeline []TimelineItem + Title string + func (snap *Snapshot) GetCreateMetadata(key string) (string, bool) + func (snap *Snapshot) HasActor(id entity.Id) bool + func (snap *Snapshot) HasAnyActor(ids ...entity.Id) bool + func (snap *Snapshot) HasAnyParticipant(ids ...entity.Id) bool + func (snap *Snapshot) HasParticipant(id entity.Id) bool + func (snap *Snapshot) Id() entity.Id + func (snap *Snapshot) IsAuthored() + func (snap *Snapshot) LastEditTime() time.Time + func (snap *Snapshot) LastEditUnix() int64 + func (snap *Snapshot) SearchComment(id entity.Id) (*Comment, error) + func (snap *Snapshot) SearchTimelineItem(id entity.Id) (TimelineItem, error) + type Status int + const ClosedStatus + const OpenStatus + func StatusFromString(str string) (Status, error) + func (s Status) Action() string + func (s Status) String() string + func (s Status) Validate() error + type StreamedBug struct + Bug *Bug + Err error + type Term256 int + func (t Term256) Escape() string + func (t Term256) Unescape() string + type TimelineItem interface + Id func() entity.Id + type WithSnapshot struct + func (b *WithSnapshot) Append(op Operation) + func (b *WithSnapshot) Commit(repo repository.ClockedRepo) error + func (b *WithSnapshot) Merge(repo repository.Repo, other Interface) (bool, error) + func (b *WithSnapshot) Snapshot() *Snapshot