index

package
v0.0.0-...-62afbb6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStop = fmt.Errorf("stop")

Functions

func AttrToString

func AttrToString(k, v string) string

func ForEach

func ForEach(idx *Index, fn func(*Entry) error) error

func WriteEntries

func WriteEntries(w io.Writer, index *Index) error

func WriteFile

func WriteFile(path string, index *Index, comment string) error

Types

type Attrs

type Attrs map[string]string

type Entry

type Entry struct {
	Name  string
	Attrs Attrs
	Loc   scanner.Loc
}

func (*Entry) AttrsWithLoc

func (e *Entry) AttrsWithLoc() Attrs

func (*Entry) IsReferredBy

func (e *Entry) IsReferredBy(them *Entry) bool

func (*Entry) IsSearch

func (e *Entry) IsSearch() (patternType string, yes bool)

func (*Entry) Matcher

func (e *Entry) Matcher() (func(*Entry) bool, error)

func (*Entry) String

func (e *Entry) String() string

type Index

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

func Filter

func Filter(idx *Index, filter func(*Entry) (bool, error)) (*Index, error)

func NewIndex

func NewIndex(ents []*Entry) *Index

func ReadFile

func ReadFile(path string) (*Index, error)

func (*Index) Add

func (i *Index) Add(ents []*Entry) *Index

Add modifies i.

func (*Index) Size

func (i *Index) Size() int

func (*Index) Slice

func (i *Index) Slice() []*Entry

Jump to

Keyboard shortcuts

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