tag

package
v0.0.0-...-d7249e8 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2016 License: MIT Imports: 11 Imported by: 0

README

Gotags

these code fork from github.com/jstemmer/gotags

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrInvalidFields

type ErrInvalidFields struct {
	Fields string
}

ErrInvalidFields is an error returned when attempting to parse invalid fields.

func (ErrInvalidFields) Error

func (e ErrInvalidFields) Error() string

type FieldSet

type FieldSet map[TagField]bool

FieldSet is a set of extension fields to include in a tag.

func (FieldSet) Includes

func (f FieldSet) Includes(field TagField) bool

Includes tests whether the given field is included in the set.

type Tag

type Tag struct {
	Name    string
	File    string
	Address string
	Type    TagType
	Fields  map[TagField]string
}

Tag represents a single tag.

func NewTag

func NewTag(name, file string, line int, tagType TagType) Tag

NewTag creates a new Tag.

func Parse

func Parse(filename string, relative bool, basepath string) ([]Tag, error)

Parse parses the source in filename and returns a list of tags. If relative is true, the filenames in the list of tags are relative to basepath.

func (Tag) String

func (t Tag) String() string

The tags file format string representation of this tag.

type TagField

type TagField string

TagField represents a single field in a tag line.

const (
	Access        TagField = "access"
	Signature     TagField = "signature"
	TypeField     TagField = "type"
	ReceiverType  TagField = "ctype"
	Line          TagField = "line"
	InterfaceType TagField = "ntype"
	Language      TagField = "language"
)

Tag fields.

type TagType

type TagType string

TagType represents the type of a tag in a tag line.

const (
	Package     TagType = "p"
	Import      TagType = "i"
	Constant    TagType = "c"
	Variable    TagType = "v"
	Type        TagType = "t"
	Interface   TagType = "n"
	Field       TagType = "w"
	Embedded    TagType = "e"
	Method      TagType = "m"
	Constructor TagType = "r"
	Function    TagType = "f"
)

Tag types.

Jump to

Keyboard shortcuts

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