web

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package web contains the Documize static web data.

Index

Constants

View Source
const (
	// SiteModeNormal serves app
	SiteModeNormal = ""
	// SiteModeOffline serves offline.html
	SiteModeOffline = "1"
	// SiteModeSetup tells Ember to serve setup route
	SiteModeSetup = "2"
	// SiteModeBadDB redirects to db-error.html page
	SiteModeBadDB = "3"
)

Variables

View Source
var SiteInfo struct {
	DBname, DBhash, Issue string
}

SiteInfo describes set-up information about the site

View Source
var SiteMode string

SiteMode defines that the web server should show the system to be in a particular state.

Functions

func Asset

func Asset(location string) ([]byte, error)

Asset fetch.

func AssetDir

func AssetDir(dir string) ([]string, error)

AssetDir returns web app "assets" folder.

func EmberHandler

func EmberHandler(w http.ResponseWriter, r *http.Request)

EmberHandler provides the webserver for pages developed using the Ember programming environment.

func ReadFile

func ReadFile(filename string) ([]byte, error)

ReadFile is intended to substitute for ioutil.ReadFile().

func StaticAssetsFileSystem

func StaticAssetsFileSystem() http.FileSystem

StaticAssetsFileSystem data encoded in the go:generate above.

Types

type EmbedHandler

type EmbedHandler interface {
	Asset(string) ([]byte, error)
	AssetDir(string) ([]string, error)
	StaticAssetsFileSystem() http.FileSystem
}

EmbedHandler is defined in each embed directory

var Embed EmbedHandler

Embed allows access to the embedded data

Jump to

Keyboard shortcuts

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