Versions in this module Expand all Collapse all v0 v0.8.0 Nov 20, 2022 Changes in this version + const AddCommentOp + const CreateOp + const EditCommentOp + const LabelChangeOp + const NoOpOp + const SetMetadataOp + const SetStatusOp + const SetTitleOp + var ClockLoader = dag.ClockLoader(def) + 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 Fetch(repo repository.Repo, remote string) (string, error) + func ListLocalIds(repo repository.Repo) ([]entity.Id, error) + func MergeAll(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, ...) <-chan entity.MergeResult + func NewErrMultipleMatchBug(matching []entity.Id) *entity.ErrMultipleMatch + func NewErrMultipleMatchOp(matching []entity.Id) *entity.ErrMultipleMatch + func NewSetMetadataOp(author identity.Interface, unixTime int64, target entity.Id, ...) *dag.SetMetadataOperation[*Snapshot] + func Pull(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, ...) error + func Push(repo repository.Repo, remote string) (string, error) + func ReadAll(repo repository.ClockedRepo) <-chan StreamedBug + func ReadAllWithResolver(repo repository.ClockedRepo, resolvers entity.Resolvers) <-chan StreamedBug + func Remove(repo repository.ClockedRepo, id entity.Id) error + func SetMetadata(b Interface, author identity.Interface, unixTime int64, target entity.Id, ...) (*dag.SetMetadataOperation[*Snapshot], error) + type AddCommentOperation struct + Files []repository.Hash + Message string + func AddComment(b Interface, author identity.Interface, unixTime int64, message string, ...) (entity.CombinedId, *AddCommentOperation, error) + func NewAddCommentOp(author identity.Interface, unixTime int64, message string, ...) *AddCommentOperation + func (op *AddCommentOperation) Apply(snapshot *Snapshot) + func (op *AddCommentOperation) GetFiles() []repository.Hash + func (op *AddCommentOperation) Id() entity.Id + func (op *AddCommentOperation) Validate() error + type AddCommentTimelineItem struct + func (a *AddCommentTimelineItem) IsAuthored() + type Bug struct + func NewBug() *Bug + func Read(repo repository.ClockedRepo, id entity.Id) (*Bug, error) + func ReadWithResolver(repo repository.ClockedRepo, resolvers entity.Resolvers, id entity.Id) (*Bug, error) + func (bug *Bug) Append(op Operation) + func (bug *Bug) Compile() *Snapshot + func (bug *Bug) FirstOp() Operation + func (bug *Bug) LastOp() Operation + func (bug *Bug) Operations() []Operation + 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 []repository.Hash + Message string + func (c Comment) CombinedId() entity.CombinedId + func (c Comment) FormatTime() string + func (c Comment) FormatTimeRel() string + func (c Comment) IsAuthored() + func (c Comment) TargetId() entity.Id + type CommentHistoryStep struct + Author identity.Interface + Message string + UnixTime timestamp.Timestamp + type CommentTimelineItem struct + Author identity.Interface + CreatedAt timestamp.Timestamp + Files []repository.Hash + History []CommentHistoryStep + LastEdit timestamp.Timestamp + Message string + func NewCommentTimelineItem(comment Comment) CommentTimelineItem + func (c *CommentTimelineItem) Append(comment Comment) + func (c *CommentTimelineItem) CombinedId() entity.CombinedId + func (c *CommentTimelineItem) Edited() bool + func (c *CommentTimelineItem) MessageIsEmpty() bool + type CreateOperation struct + Files []repository.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() []repository.Hash + func (op *CreateOperation) Id() entity.Id + func (op *CreateOperation) Validate() error + type CreateTimelineItem struct + func (c *CreateTimelineItem) IsAuthored() + type EditCommentOperation struct + Files []repository.Hash + Message string + Target entity.Id + func EditComment(b Interface, author identity.Interface, unixTime int64, target entity.Id, ...) (entity.CombinedId, *EditCommentOperation, error) + func EditCreateComment(b Interface, author identity.Interface, unixTime int64, message string, ...) (entity.CombinedId, *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() []repository.Hash + func (op *EditCommentOperation) Id() entity.Id + func (op *EditCommentOperation) Validate() error + type Interface interface + 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) 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 + func (l *LabelChangeStatus) UnmarshalGQL(v interface{}) error + func (l LabelChangeStatus) MarshalGQL(w io.Writer) + type LabelChangeTimelineItem struct + Added []Label + Author identity.Interface + Removed []Label + UnixTime timestamp.Timestamp + func (l *LabelChangeTimelineItem) IsAuthored() + func (l LabelChangeTimelineItem) CombinedId() entity.CombinedId + type LabelColor color.RGBA + func (lc LabelColor) RGBA() color.RGBA + func (lc LabelColor) Term256() Term256 + type Operation interface + Apply func(snapshot *Snapshot) + type SetStatusOperation struct + Status common.Status + func Close(b Interface, author identity.Interface, unixTime int64, ...) (*SetStatusOperation, error) + func NewSetStatusOp(author identity.Interface, unixTime int64, status common.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) Validate() error + type SetStatusTimelineItem struct + Author identity.Interface + Status common.Status + UnixTime timestamp.Timestamp + func (s *SetStatusTimelineItem) IsAuthored() + func (s SetStatusTimelineItem) CombinedId() entity.CombinedId + 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) Validate() error + type SetTitleTimelineItem struct + Author identity.Interface + Title string + UnixTime timestamp.Timestamp + Was string + func (s *SetTitleTimelineItem) IsAuthored() + func (s SetTitleTimelineItem) CombinedId() entity.CombinedId + type SimpleResolver struct + func NewSimpleResolver(repo repository.ClockedRepo) *SimpleResolver + func (r *SimpleResolver) Resolve(id entity.Id) (entity.Interface, error) + type Snapshot struct + Actors []identity.Interface + Author identity.Interface + Comments []Comment + CreateTime time.Time + Labels []Label + Operations []dag.Operation + Participants []identity.Interface + Status common.Status + Timeline []TimelineItem + Title string + func (snap *Snapshot) AllOperations() []dag.Operation + func (snap *Snapshot) EditTime() time.Time + 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) SearchComment(id entity.CombinedId) (*Comment, error) + func (snap *Snapshot) SearchCommentByOpId(id entity.Id) (*Comment, error) + func (snap *Snapshot) SearchTimelineItem(id entity.CombinedId) (TimelineItem, error) + type StreamedBug struct + Bug *Bug + Err error + type Term256 int + func (t Term256) Escape() string + func (t Term256) Unescape() string + type TimelineItem interface + CombinedId func() entity.CombinedId + type WithSnapshot struct + func (b *WithSnapshot) Append(op Operation) + func (b *WithSnapshot) Commit(repo repository.ClockedRepo) error + func (b *WithSnapshot) Compile() *Snapshot