node

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

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) Search

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

Search 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