server

package
v0.0.0-...-83bb0d8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must(err error)

Types

type App

type App struct {
	Engine *gin.Engine
	React  *React
}

func NewApp

func NewApp(opts ...AppOptions) *App

func (*App) Run

func (a *App) Run(addr string)

type AppOptions

type AppOptions struct {
	Debug bool
}

type BinaryFileSystem

type BinaryFileSystem struct {
	Root string
	Fs   http.FileSystem
}

func NewBinaryFileSystem

func NewBinaryFileSystem(root string) *BinaryFileSystem

func (*BinaryFileSystem) CreateServer

func (b *BinaryFileSystem) CreateServer() http.Handler

func (*BinaryFileSystem) CreateTemplate

func (b *BinaryFileSystem) CreateTemplate(path string) (*template.Template, error)

func (*BinaryFileSystem) Exists

func (b *BinaryFileSystem) Exists(filepath string) bool

func (*BinaryFileSystem) Open

func (b *BinaryFileSystem) Open(name string) (http.File, error)

type React

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

func NewReact

func NewReact(debug bool, path string, template string, engine http.Handler) *React

func (*React) Handle

func (r *React) Handle(c *gin.Context)

type ReactVM

type ReactVM struct {
	*duktape.Context
	// contains filtered or unexported fields
}

func (*ReactVM) DestroyHeap

func (r *ReactVM) DestroyHeap()

func (*ReactVM) Handle

func (r *ReactVM) Handle(req map[string]interface{}) <-chan Resp

type Resp

type Resp struct {
	UUID       string        `json:"uuid"`
	Error      string        `json:"error"`
	Redirect   string        `json:"redirect"`
	App        string        `json:"app"`
	Title      string        `json:"title"`
	Meta       string        `json:"meta"`
	Initial    string        `json:"initial"`
	RenderTime time.Duration `json:"-"`
}

func (Resp) HTMLApp

func (r Resp) HTMLApp() template.HTML

func (Resp) HTMLMeta

func (r Resp) HTMLMeta() template.HTML

func (Resp) HTMLTitle

func (r Resp) HTMLTitle() template.HTML

Jump to

Keyboard shortcuts

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