collector

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2019 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Type     interface{} `json:"type,omitempty"`
	RecvOnly bool        `json:"recv_only,omitempty"`
	SendOnly bool        `json:"send_only,omitempty"`
}

type Comment

type Comment struct {
	Content string `json:"content,omitempty"`
}

func (Comment) Lines

func (c Comment) Lines() []string

Lines converts any comment into a slice of strings based on their logical line-based grouping.

type Const

type Const struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Name             string            `json:"name,omitempty"`
	Type             string            `json:"type,omitempty"`
	Value            interface{}       `json:"value,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
}

type Constraint

type Constraint struct {
	Options []string `json:"options,omitempty"`
}

Constraint holds the options of a build tag. +build linux,386 darwin,!cgo

|-------| |---------|
 option      option

func (Constraint) String

func (c Constraint) String() string

type Data

type Data struct {
	OutputBase string    `json:"output_base"`
	Packages   []Package `json:"packages,omitempty"`
}

type File

type File struct {
	Name             string            `json:"name,omitempty"`
	Package          string            `json:"package,omitempty"`
	Imports          []Import          `json:"imports,omitempty"`
	TypeDefs         []TypeDefinition  `json:"type_defs,omitempty"`
	Structs          []Struct          `json:"structs,omitempty"`
	Interfaces       []Interface       `json:"interfaces,omitempty"`
	Funcs            []Func            `json:"funcs,omitempty"`
	Consts           []Const           `json:"consts,omitempty"`
	Vars             []Var             `json:"vars,omitempty"`
	Comments         []Comment         `json:"comments,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
	BuildTags        []Constraint      `json:"build_tags,omitempty"`
}

type FileCollector

type FileCollector struct {
	Imports          []Import
	Consts           []Const
	Vars             []Var
	Structs          []Struct
	TypeDefs         []TypeDefinition
	Interfaces       []Interface
	Funcs            []Func
	Comments         []Comment
	MagicComments    []MagicComment
	GenerateComments []GenerateComment
	BuildTags        []Constraint
}

func (*FileCollector) Visit

func (c *FileCollector) Visit(node ast.Node) ast.Visitor

type Func

type Func struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Name             string            `json:"name,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
	Params           []Value           `json:"params,omitempty"`
	Results          []Value           `json:"results,omitempty"`
}

type GenerateComment

type GenerateComment struct {
	Command string `json:"command,omitempty"` // goyacc -o gopher.go -p parser gopher.y
	Raw     string `json:"raw,omitempty"`     // go:generate goyacc -o gopher.go -p parser gopher.y
}

func (GenerateComment) Cmd

func (g GenerateComment) Cmd() (*exec.Cmd, error)

type Import

type Import struct {
	Name             string            `json:"name,omitempty"`
	Path             string            `json:"path,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
}

type Interface

type Interface struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Embed            bool              `json:"embed,omitempty"`
	Name             string            `json:"name,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MethodSet        []InterfaceField  `json:"method_set,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
}

type InterfaceField

type InterfaceField interface{}

type MagicComment

type MagicComment struct {
	Pragma string `json:"pragma,omitempty"` // noinline
	Raw    string `json:"raw,omitempty"`    // go:noinline
}

type Map

type Map struct {
	KeyType   string   `json:"key_type,omitempty"`
	ValueType MapValue `json:"value_type,omitempty"`
}

func (Map) String

func (m Map) String() string

type MapValue

type MapValue struct {
	Name  string      `json:"name,omitempty"`
	Value interface{} `json:"value,omitempty"`
}

type Method

type Method struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Name             string            `json:"name,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
	Receiver         string            `json:"receiver,omitempty"`
	ReceiverIndirect bool              `json:"receiver_indirect,omitempty"`
	Params           []Value           `json:"params,omitempty"`
	Results          []Value           `json:"results,omitempty"`
}

type Package

type Package struct {
	Name  string `json:"name,omitempty"`
	Files []File `json:"files,omitempty"`
}

type Struct

type Struct struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Name             string            `json:"name,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
	Fields           []StructField     `json:"fields,omitempty"`
	Methods          []Method          `json:"methods,omitempty"`
}

type StructField

type StructField struct {
	Indirect         bool              `json:"indirect,omitempty"`
	Embed            bool              `json:"embed,omitempty"`
	IsMap            bool              `json:"is_map,omitempty"`
	IsExported       bool              `json:"is_exported,omitempty"`
	IsInterface      bool              `json:"is_interface,omitempty"`
	IsSlice          bool              `json:"is_slice,omitempty"`
	IsArray          bool              `json:"is_array,omitempty"`
	ArrayLen         string            `json:"array_length,omitempty"`
	Name             string            `json:"name,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
	Type             interface{}       `json:"field_type,omitempty"`
	Tag              string            `json:"tag,omitempty"`
}

type TypeDefinition

type TypeDefinition struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Name             string            `json:"name,omitempty"`
	Type             string            `json:"type,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
	Methods          []Method          `json:"methods,omitempty"`
}

type Value

type Value struct {
	Name *string `json:"name,omitempty"`
	Type string  `json:"type,omitempty"`
}

func (Value) String

func (v Value) String() string

type ValueType

type ValueType struct {
	Kind  string      `json:"kind,omitempty"`
	Value interface{} `json:"value,omitempty"`
}

type Var

type Var struct {
	IsExported       bool              `json:"is_exported,omitempty"`
	Name             string            `json:"name,omitempty"`
	Type             string            `json:"type,omitempty"`
	Value            interface{}       `json:"value,omitempty"`
	Doc              Comment           `json:"doc,omitempty"`
	Comment          Comment           `json:"comment,omitempty"`
	MagicComments    []MagicComment    `json:"magic_comments,omitempty"`
	GenerateComments []GenerateComment `json:"generate_comments,omitempty"`
}

Jump to

Keyboard shortcuts

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