issue

package
v0.0.0-...-01e3f2b Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidPriorities = []string{"low", "medium", "high", "critical"}
View Source
var ValidStatuses = []string{"open", "in-progress", "closed", "wontfix"}

Functions

func AddRelation

func AddRelation(issuesDir string, sourceID int, relation string, targetID int, cfg *config.Config) error

func AddToSlice

func AddToSlice(iss *Issue, relation string, id int)

func Delete

func Delete(issuesDir string, id int) error

func Filename

func Filename(id int, slug string) string

func GenerateSlug

func GenerateSlug(title string) string

func Inverse

func Inverse(relation string) string

func IssuesDir

func IssuesDir() (string, error)

func Marshal

func Marshal(issue *Issue) []byte

func NextID

func NextID(issuesDir string) (int, error)

func PriorityRank

func PriorityRank(priority string) int

func RemoveFromSlice

func RemoveFromSlice(iss *Issue, relation string, id int)

func RemoveRelation

func RemoveRelation(issuesDir string, sourceID int, relation string, targetID int, cfg *config.Config) error

func Save

func Save(issuesDir string, issue *Issue) error

func Today

func Today() string

func Validate

func Validate(issue *Issue) error

Types

type Issue

type Issue struct {
	ID        int       `yaml:"id" json:"id"`
	Title     string    `yaml:"title" json:"title"`
	Status    string    `yaml:"status" json:"status"`
	Priority  string    `yaml:"priority" json:"priority"`
	Labels    []string  `yaml:"labels" json:"labels"`
	Relations Relations `yaml:"relations,omitempty" json:"relations,omitempty"`
	Created   string    `yaml:"created" json:"created"`
	Updated   string    `yaml:"updated" json:"updated"`
	Closed    string    `yaml:"closed,omitempty" json:"closed,omitempty"`

	Body     string `yaml:"-" json:"-"`
	FilePath string `yaml:"-" json:"-"`
}

func LoadAll

func LoadAll(issuesDir string) ([]*Issue, error)

func LoadByID

func LoadByID(issuesDir string, id int) (*Issue, error)

func Parse

func Parse(content string) (*Issue, error)

func ParseFile

func ParseFile(filePath string) (*Issue, error)

type RelationEntry

type RelationEntry struct {
	Relation string
	ID       int
}

func DiffRelations

func DiffRelations(oldRel, newRel Relations) (added, removed []RelationEntry)

type Relations

type Relations struct {
	Blocks     []int `yaml:"blocks,omitempty" json:"blocks,omitempty"`
	DependsOn  []int `yaml:"depends-on,omitempty" json:"depends-on,omitempty"`
	RelatedTo  []int `yaml:"related-to,omitempty" json:"related-to,omitempty"`
	Duplicates []int `yaml:"duplicates,omitempty" json:"duplicates,omitempty"`
}

Jump to

Keyboard shortcuts

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