trace

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func IsValidType

func IsValidType(t string) bool

func NewID

func NewID(title string) string

NewID generates a trace ID from a title: YYYYMMDD-slugified-title.

Types

type Frontmatter

type Frontmatter struct {
	ID      string   `yaml:"id"`
	Title   string   `yaml:"title"`
	Type    string   `yaml:"type"`
	Author  string   `yaml:"author,omitempty"`
	Tags    []string `yaml:"tags,omitempty"`
	Created string   `yaml:"created"`
	Updated string   `yaml:"updated"`
}

type Trace

type Trace struct {
	Frontmatter
	Body string
}

func New

func New(title, traceType, author string, tags []string, body string) *Trace

func Parse

func Parse(data []byte) (*Trace, error)

func ParseFile

func ParseFile(path string) (*Trace, error)

func (*Trace) Write

func (t *Trace) Write(path string) error

type Type

type Type string
const (
	TypeFact        Type = "fact"
	TypeDecision    Type = "decision"
	TypePreference  Type = "preference"
	TypeContext     Type = "context"
	TypeSkill       Type = "skill"
	TypeIntent      Type = "intent"
	TypeObservation Type = "observation"
	TypeNote        Type = "note"
)

Jump to

Keyboard shortcuts

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