devutil

package
v0.0.0-...-57186e4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWASM

func BuildWASM(mainGo string, out string) error

func BuildWASMTiny

func BuildWASMTiny(mainGo string, out string) error

tinygo build -o tiny.wasm -target wasm cmd/main.go

func CopyDirectory

func CopyDirectory(scrDir, dest string) error

func CopyFile

func CopyFile(source string, target string) error

func CreateDirIfNotExists

func CreateDirIfNotExists(dir string, perm os.FileMode) error

func ExistsFile

func ExistsFile(path string) bool

func ExistsFolder

func ExistsFolder(path string) bool

func Make

func Make(srcDir, distDir string) error

Types

type Generator

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

func NewGenerator

func NewGenerator(opts ...Option) (*Generator, error)

func (*Generator) Process

func (g *Generator) Process(in io.Reader, out io.Writer, name, pkg string) error

func (*Generator) ProcessDir

func (g *Generator) ProcessDir(dir string) error

func (*Generator) ProcessFile

func (g *Generator) ProcessFile(inFile, outFile string, name, pkg string) error

type HandlerOption

type HandlerOption func(h *MakeServeHandler) error

func WithHook

func WithHook(fnc func()) HandlerOption

type MakeServeHandler

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

func NewMakeServeHandler

func NewMakeServeHandler(src, dist, wasm string, opts ...HandlerOption) (*MakeServeHandler, error)

func (*MakeServeHandler) ServeHTTP

func (h *MakeServeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Manifest

type Manifest struct {
	Build     string `json:"build"`
	MainGo    string `json:"main"`
	AssetsDir string `json:"assets,omitempty"`
	CSSDir    string `json:"css,omitempty"`
	EnvJS     string `json:"env,omitempty"`
}

type Option

type Option func(*Generator) error

Jump to

Keyboard shortcuts

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