gopkg

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPath     = "path"     // jsonpath
	AnnotationDocument = "document" // begin document
	AnnotationTitle    = "title"    // for markdown heading: #
)

Variables

View Source
var (
	ErrDocument = errors.New("DocumentError")
)

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Key   string
	Value string
	Linum int // 0 based
}

type Comment

type Comment struct {
	Text string `json:"text"`
	Path string `json:"path"`
	Line int    `json:"line"`
}

func (*Comment) GetAnnotation

func (c *Comment) GetAnnotation(key string) (*Annotation, bool)

func (*Comment) GetDocument

func (c *Comment) GetDocument() (*Document, error)

type Document

type Document struct {
	Path  string `json:"path"`  // @path
	Text  string `json:"text"`  // @document
	Title string `json:"title"` // @title
	File  string `json:"file"`
	Line  int    `json:"line"`
}

func (*Document) String

func (d *Document) String() string

type DocumentMap

type DocumentMap = jsonmap.Map[*Document]

type DocumentSet

type DocumentSet struct {
	// contains filtered or unexported fields
}

func NewDocumentSet

func NewDocumentSet(doc ...*Document) *DocumentSet

func (*DocumentSet) Get

func (s *DocumentSet) Get(key string) (string, bool)

func (*DocumentSet) IntoFiles

func (s *DocumentSet) IntoFiles(root string) error

func (*DocumentSet) Keys

func (s *DocumentSet) Keys() []string

func (*DocumentSet) MarshalJSON

func (s *DocumentSet) MarshalJSON() ([]byte, error)

func (*DocumentSet) UnmarshalJSON

func (s *DocumentSet) UnmarshalJSON(b []byte) error

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader() *Loader

func (*Loader) Comments

func (r *Loader) Comments() iter.Seq[*Comment]

func (*Loader) Get

func (r *Loader) Get() []*packages.Package

func (*Loader) Load

func (r *Loader) Load(ctx context.Context, pattern ...string) error

Jump to

Keyboard shortcuts

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