metadata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package metadata provides common metadata types used across structured documents. These types ensure consistent representation of authors, versions, and status across PRD, MRD, TRD, V2MOM, OKR, Changelog, and Roadmap documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	// Name is the author's full name (required).
	Name string `json:"name"`

	// Email is the author's email address (optional).
	Email string `json:"email,omitempty"`

	// Role is the author's role (e.g., "Product Manager", "Tech Lead").
	Role string `json:"role,omitempty"`

	// URL is a link to the author's profile (optional).
	URL string `json:"url,omitempty"`
}

Author represents a document author or contributor.

type Metadata

type Metadata struct {
	// ID is the unique document identifier.
	ID string `json:"id,omitempty"`

	// Title is the document title.
	Title string `json:"title,omitempty"`

	// Name is an alternative to Title (used by some document types).
	Name string `json:"name,omitempty"`

	// Version is the document version (e.g., "1.0.0", "2024.Q1").
	Version string `json:"version,omitempty"`

	// Status is the document status.
	Status Status `json:"status,omitempty"`

	// Authors is the list of document authors.
	Authors []Author `json:"authors,omitempty"`

	// Owner is the document owner (alternative to Authors for single-owner docs).
	Owner string `json:"owner,omitempty"`

	// CreatedAt is when the document was created.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// UpdatedAt is when the document was last updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Description is a brief description of the document.
	Description string `json:"description,omitempty"`

	// Tags are labels for categorization.
	Tags []string `json:"tags,omitempty"`
}

Metadata contains common metadata fields for structured documents.

func (Metadata) GetOwner

func (m Metadata) GetOwner() string

GetOwner returns the owner, or the first author's name if owner is empty.

func (Metadata) GetTitle

func (m Metadata) GetTitle() string

GetTitle returns the title, falling back to name if title is empty.

func (*Metadata) SetCreated

func (m *Metadata) SetCreated()

SetCreated sets the CreatedAt timestamp if not already set.

func (*Metadata) Touch

func (m *Metadata) Touch()

Touch updates the UpdatedAt timestamp to the current time.

type Priority

type Priority string

Priority represents the priority level of an item.

const (
	PriorityCritical Priority = "critical"
	PriorityHigh     Priority = "high"
	PriorityMedium   Priority = "medium"
	PriorityLow      Priority = "low"
)

Priority levels.

const (
	PriorityP0 Priority = "P0"
	PriorityP1 Priority = "P1"
	PriorityP2 Priority = "P2"
	PriorityP3 Priority = "P3"
)

P-notation priority levels.

func Priorities

func Priorities() []Priority

Priorities returns the list of standard priorities.

func (Priority) Level

func (p Priority) Level() int

Level returns a numeric level (0 = highest priority).

func (Priority) Normalize

func (p Priority) Normalize() Priority

Normalize converts P-notation to standard priority.

func (Priority) String

func (p Priority) String() string

String returns the priority as a string.

type Status

type Status string

Status represents the status of a document or item.

const (
	StatusDraft      Status = "draft"
	StatusReview     Status = "review"
	StatusApproved   Status = "approved"
	StatusActive     Status = "active"
	StatusDeprecated Status = "deprecated"
	StatusArchived   Status = "archived"
)

Common document statuses.

const (
	StatusNotStarted Status = "not_started"
	StatusPlanning   Status = "planning"
	StatusInProgress Status = "in_progress"
	StatusCompleted  Status = "completed"
	StatusBlocked    Status = "blocked"
	StatusOnHold     Status = "on_hold"
	StatusCancelled  Status = "cancelled"
)

Common item/task statuses.

const (
	StatusOnTrack Status = "on_track"
	StatusAtRisk  Status = "at_risk"
	StatusBehind  Status = "behind"
)

Common tracking statuses.

func DocumentStatuses

func DocumentStatuses() []Status

DocumentStatuses returns the list of valid document statuses.

func ItemStatuses

func ItemStatuses() []Status

ItemStatuses returns the list of valid item/task statuses.

func TrackingStatuses

func TrackingStatuses() []Status

TrackingStatuses returns the list of valid tracking statuses.

func (Status) Display

func (s Status) Display() string

Display returns a human-readable display string.

func (Status) IsActive

func (s Status) IsActive() bool

IsActive returns true if the status indicates active work.

func (Status) IsBlocking

func (s Status) IsBlocking() bool

IsBlocking returns true if the status indicates a blocking condition.

func (Status) IsComplete

func (s Status) IsComplete() bool

IsComplete returns true if the status indicates completion.

func (Status) String

func (s Status) String() string

String returns the status as a string.

Jump to

Keyboard shortcuts

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