web

package
v0.0.0-...-2ce39b0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPublicDir decides where look for public files
	DefaultPublicDir = "public"

	// DefaultTemplateDir decides where look for templates files
	DefaultTemplateDir = "templates"

	// DefaultVerbose decides if you wanna be bored by some noisy logs
	DefaultVerbose = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is the ElasticBook Web App (Martini powered)

func NewApp

func NewApp(options ...AppOptionFunc) (*App, error)

NewApp Set up the default application

func (*App) Start

func (a *App) Start()

Start open a local server

type AppOptionFunc

type AppOptionFunc func(*App) error

AppOptionFunc is a function that configures a App. It is used in NewApp.

func SetPublicDir

func SetPublicDir(t string) AppOptionFunc

SetPublicDir define the current PublicDir used

func SetTemplateDir

func SetTemplateDir(t string) AppOptionFunc

SetTemplateDir define the current TemplateDir used

func SetVerbose

func SetVerbose(vvv bool) AppOptionFunc

SetVerbose define the verbose logging

type IndexAlias

type IndexAlias struct {
	Index int
	Name  string
}

IndexAlias contains an index name and its aliases

type Result

type Result struct {
	Index     int
	URL       string
	Title     string
	DateAdded string
	Score     float64
}

Result is the result of a search

type Search struct {
	ID      int64 `db:"id"`
	Created int64
	Term    string `form:"term" binding:"required"`
}

Search represent a search request made from the WebInterface

type Suggest

type Suggest struct {
	Term string `form:"term"`
}

Suggest is the data sent without pressing the key.

Jump to

Keyboard shortcuts

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