gojs

package
v0.0.0-...-7db68c6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 10 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCode

func GenerateCode(options GenerateOptions) (code string, err error)

Types

type GenerateOptions

type GenerateOptions struct {
	TemplateName string
	PackagePath  string
	PackageAlias string
	GoPath       string
	ProjectPath  string

	TemplateVars *TemplateVars

	Args interface{}
}

type GojaModule

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

func (*GojaModule) Enable

func (p *GojaModule) Enable(runtime Runtime)

func (*GojaModule) Name

func (p *GojaModule) Name() string

func (*GojaModule) Register

func (p *GojaModule) Register() Module

func (*GojaModule) Require

func (p *GojaModule) Require(runtime *goja.Runtime, module *goja.Object)

func (*GojaModule) Set

func (p *GojaModule) Set(objects Objects) Module

func (*GojaModule) String

func (p *GojaModule) String() string

type Module

type Module interface {
	Name() string
	Set(objects Objects) Module
	Enable(Runtime)
	Register() Module
}

func NewGojaModule

func NewGojaModule(name string) Module

func NewOttoModule

func NewOttoModule(name string) Module

type Object

type Object interface {
	Set(string, interface{})
	Get(string) interface{}
}

type Objects

type Objects map[string]interface{}

type OttoModule

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

func (*OttoModule) Enable

func (p *OttoModule) Enable(runtime Runtime)

func (*OttoModule) Name

func (p *OttoModule) Name() string

func (*OttoModule) Register

func (p *OttoModule) Register() Module

func (*OttoModule) Set

func (p *OttoModule) Set(objects Objects) Module

func (*OttoModule) String

func (p *OttoModule) String() string

type Runtime

type Runtime interface {
	Set(string, interface{})
}

type TemplateVars

type TemplateVars struct {
	PackageName  string
	PackagePath  string
	PackageVars  map[string]string
	PackageTypes map[string]string
	PackageFuncs map[string]string

	Args map[string]interface{}
}

func Parser

func Parser(pkgPath string, gopath string) (vars *TemplateVars, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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