extract

package
v0.0.0-...-9034458 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSource

func ParseSource(file string, bytes []byte, snip Snip) (err error)

ParseSource, the original .go files on disk, and generate file, line, and source code snippers for every callback encountered.

func WriteJsonModel

func WriteJsonModel(w io.Writer, name string, m *M.Model) (err error)

func WriteModel

func WriteModel(w io.Writer, s ModelSnippet) (err error)

cool, but unless we can deep copy the output, this is useless

func WriteSnippets

func WriteSnippets(w io.Writer, cx *CallExtractor, packages ...string) (err error)

Types

type CallExtractor

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

func NewCallExtractor

func NewCallExtractor(pkgname string, path string, trace io.Writer) *CallExtractor

path, optional, for more readable strings.

func (*CallExtractor) CompileCallback

func (cx *CallExtractor) CompileCallback(cb G.Callback) (ret ident.Id, err error)

CompileCallback implments the compiler interface to turn a callback function into a callback marker.

func (*CallExtractor) Count

func (cx *CallExtractor) Count() int

func (*CallExtractor) Find

func (cx *CallExtractor) Find(k string) bool

func (*CallExtractor) Trace

func (cx *CallExtractor) Trace(args ...interface{})

type ModelConfig

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

func NewModelConfig

func NewModelConfig(m *M.Model) *ModelConfig

func (*ModelConfig) GetSnippet

func (cfg *ModelConfig) GetSnippet() ModelSnippet

func (*ModelConfig) PackageName

func (cfg *ModelConfig) PackageName(s string) *ModelConfig

type ModelSnippet

type ModelSnippet struct {
	Model   *M.Model
	PkgName string
}

type Snip

type Snip func(file string, line int, snippet []byte) error

type Snippet

type Snippet struct {
	File    string
	Line    int
	Content string
}

func (Snippet) String

func (s Snippet) String() string

Jump to

Keyboard shortcuts

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