node

package
v0.0.0-...-87b999f Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2018 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(node ast.Node, name string) (*astext.Object, error)

Find finds a node by name in a parent node.

Types

type Item

type Item struct {
	Type ItemType
	Name string
	Path []string
}

Item identifies an item in a Node.

type ItemType

type ItemType int

ItemType is the type of item.

const (
	// ItemTypeSetter is a item that is a setter function.
	ItemTypeSetter ItemType = iota
	// ItemTypeObject is a item that is an object.
	ItemTypeObject
)

type Members

type Members struct {
	Fields    []string
	Functions []string
	Types     []string
}

Members are the members of an object.

func FindMembers

func FindMembers(obj *astext.Object) (Members, error)

FindMembers finds all the object members.

func (*Members) FindFunction

func (om *Members) FindFunction(name string) (string, error)

type Node

type Node struct {
	IsMixin bool
	// contains filtered or unexported fields
}

Node represents a node by name.

func New

func New(name string, obj *astext.Object) *Node

New creates an instance of Node.

func (*Node) Search2

func (n *Node) Search2(path ...string) (*Item, error)

Search2 searches for a path in the node.

Jump to

Keyboard shortcuts

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