format

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package format provides ASCII formatting for Linear resources. This is a token-efficient alternative to Markdown templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string

Format specifies the level of detail in formatted output

const (
	// Minimal returns only essential fields (~50 tokens per issue)
	Minimal Format = "minimal"
	// Compact returns commonly needed fields (~150 tokens per issue)
	Compact Format = "compact"
	// Full returns all fields (~500 tokens per issue)
	Full Format = "full"
)

func ParseFormat

func ParseFormat(s string) (Format, error)

ParseFormat parses a string into a Format with validation

type Formatter

type Formatter struct{}

Formatter formats Linear resources as ASCII text

func New

func New() *Formatter

New creates a new Formatter

func (*Formatter) Comment

func (f *Formatter) Comment(comment *linear.Comment) string

Comment formats a single comment

func (*Formatter) CommentList

func (f *Formatter) CommentList(comments []linear.Comment, page *Pagination) string

CommentList formats a list of comments with optional pagination

func (*Formatter) Cycle

func (f *Formatter) Cycle(cycle *linear.Cycle, fmt Format) string

Cycle formats a single cycle

func (*Formatter) CycleAnalysis

func (f *Formatter) CycleAnalysis(analysis *linear.CycleAnalysis, teamName, assigneeName string, showRecommendation bool) string

CycleAnalysis formats cycle analytics data

func (*Formatter) CycleList

func (f *Formatter) CycleList(cycles []linear.Cycle, fmt Format, page *Pagination) string

CycleList formats a list of cycles with optional pagination

func (*Formatter) Issue

func (f *Formatter) Issue(issue *linear.Issue, fmt Format) string

Issue formats a single issue

func (*Formatter) IssueList

func (f *Formatter) IssueList(issues []linear.Issue, fmt Format, page *Pagination) string

IssueList formats a list of issues with optional pagination

func (*Formatter) Project

func (f *Formatter) Project(project *linear.Project) string

Project formats a single project

func (*Formatter) ProjectList

func (f *Formatter) ProjectList(projects []linear.Project, page *Pagination) string

ProjectList formats a list of projects with optional pagination

func (*Formatter) Team

func (f *Formatter) Team(team *linear.Team) string

Team formats a single team

func (*Formatter) TeamList

func (f *Formatter) TeamList(teams []linear.Team, page *Pagination) string

TeamList formats a list of teams with optional pagination

func (*Formatter) User

func (f *Formatter) User(user *linear.User) string

User formats a single user

func (*Formatter) UserList

func (f *Formatter) UserList(users []linear.User, page *Pagination) string

UserList formats a list of users with optional pagination

type Pagination

type Pagination struct {
	Start       int  // Starting position (0-indexed)
	Limit       int  // Items per page
	Count       int  // Items in this page
	TotalCount  int  // Total items
	HasNextPage bool // More results exist
	// Deprecated: Use offset-based pagination instead
	EndCursor string // Cursor for cursor-based pagination
}

Pagination holds pagination metadata for list responses

Jump to

Keyboard shortcuts

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