frontend

package
v0.0.0-...-894ab8b Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2014 License: MIT Imports: 6 Imported by: 6

Documentation

Overview

Package frontend defines the interface a frontend server should comply to.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Locale   string
	Vars     map[string]string
	Query    url.Values
	Form     url.Values
	Url      string
	User     user.Name
	Protocol string
	Host     string

	Email string // for password reset

	Defaults url.Values // default form values
	Errors   ErrorMap   // errors on form submit
}

func (*Context) FlavorId

func (c *Context) FlavorId(key string) (content.FlavorId, error)

func (*Context) IsFocusOnA

func (c *Context) IsFocusOnA() bool

func (*Context) LoggedIn

func (c *Context) LoggedIn() bool

func (*Context) ProtocolAndHost

func (c *Context) ProtocolAndHost() string

type ErrorMap

type ErrorMap map[string]i18n.Key

type FlavorTriple

type FlavorTriple struct {
	Audio      *content.Flavor
	Text       *content.Flavor
	Transcript *content.Flavor
}

func (*FlavorTriple) Language

func (t *FlavorTriple) Language() language.Code

type Server

type Server interface {
	SetLanguageList([]language.Code) error

	Home(context *Context) ([]byte, error)
	Error(context *Context) ([]byte, error)
	NotFound(context *Context) ([]byte, error)

	Flavor(context *Context, e *content.Extract, a, b *FlavorTriple) ([]byte, error)

	NewExtract(context *Context) ([]byte, error)
	NewFlavor(context *Context, e *content.Extract) ([]byte, error)
	EditText(context *Context, e *content.Extract, a, b *content.Flavor) ([]byte, error)

	SignUp(context *Context) ([]byte, error)
	SignIn(context *Context) ([]byte, error)
	ForgotPassword(context *Context) ([]byte, error)
	PasswordSent(context *Context) ([]byte, error)
	ResetPassword(context *Context) ([]byte, error)
	PasswordResetEmail(c *Context, a *user.Account, token string) ([]byte, error)
}

Server is the interface a frontend server should comply to.

Directories

Path Synopsis
Package handle contains frontend handler functions.
Package handle contains frontend handler functions.
Package router contains the route definitions for the frontend server.
Package router contains the route definitions for the frontend server.
Package rpc provides the rpc frontend client used by the Polyglottis Application and a simple frontend server wrapper.
Package rpc provides the rpc frontend client used by the Polyglottis Application and a simple frontend server wrapper.

Jump to

Keyboard shortcuts

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