remark

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateType

func ValidateType(t string) bool

ValidateType checks if a string is a valid remark type

Types

type Remark

type Remark struct {
	ID        string    `yaml:"id"`
	Type      Type      `yaml:"type"`
	Branch    string    `yaml:"branch"`
	State     State     `yaml:"state"`
	CreatedAt time.Time `yaml:"created_at"`
	Body      string    `yaml:"body"`
}

Remark represents a single note attached to a commit

func NewRemark

func NewRemark(remarkType Type, branch, body string) Remark

NewRemark creates a new remark with a generated ID

type Remarks

type Remarks struct {
	Remarks []Remark `yaml:"remarks"`
}

Remarks is a container for multiple remarks on a single commit

func ParseRemarks

func ParseRemarks(data []byte) (*Remarks, error)

ParseRemarks parses YAML content into Remarks

func (*Remarks) ActiveForBranch

func (r *Remarks) ActiveForBranch(branch string) []Remark

ActiveForBranch returns all active remarks for a given branch

func (*Remarks) Add

func (r *Remarks) Add(remark Remark)

Add adds a new remark to the collection

func (*Remarks) FindByID

func (r *Remarks) FindByID(id string) *Remark

FindByID finds a remark by its ID

func (*Remarks) IsEmpty

func (r *Remarks) IsEmpty() bool

IsEmpty returns true if there are no remarks

func (*Remarks) Marshal

func (r *Remarks) Marshal() ([]byte, error)

Marshal converts Remarks to YAML

func (*Remarks) Merge

func (r *Remarks) Merge(other *Remarks)

Merge combines remarks from another Remarks collection

func (*Remarks) RemoveByID

func (r *Remarks) RemoveByID(id string) bool

RemoveByID removes a remark by its ID and returns true if found

type State

type State string

State represents the state of a remark

const (
	StateActive   State = "active"
	StateResolved State = "resolved"
)

type Type

type Type string

Type represents the type of remark

const (
	TypeThought  Type = "thought"
	TypeDoubt    Type = "doubt"
	TypeTodo     Type = "todo"
	TypeDecision Type = "decision"
)

Jump to

Keyboard shortcuts

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