scenario

package
Version: v0.0.0-...-9044698 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: MIT Imports: 23 Imported by: 1

Documentation

Overview

Copyright 2015 Yury Kozyrev. All rights reserved. Proprietary license.

Copyright 2015 Home24 AG. All rights reserved. Proprietary license.

Copyright 2015 Kozyrev Yury. All rights reserved. Proprietary license.

Index

Constants

View Source
const (
	TokenLength int           = 32
	TtlDuration time.Duration = 20 * time.Minute
)
View Source
const ApiVersion = "v1"

Variables

View Source
var Templates = make(map[string]*template.Template)

Functions

func ApiPing

func ApiPing() func(http.ResponseWriter, *http.Request)

func ApiRouter

func ApiRouter(userRepository *repository.UserRepository, tRep *repository.TranslationRepository, tr t.Translator) http.Handler

func ApiTranslate

func ApiTranslate(w http.ResponseWriter, r *http.Request) (interface{}, int)

func CheckExists

func CheckExists(w rest.ResponseWriter, r *rest.Request)

func Create

func Create(w http.ResponseWriter, r *http.Request) (interface{}, int)

func Default

func Default(w http.ResponseWriter, r *http.Request) (interface{}, int)

func Delete

func Delete(w http.ResponseWriter, r *http.Request) (interface{}, int)

func DeleteParticular

func DeleteParticular(w http.ResponseWriter, r *http.Request) (interface{}, int)

func Get

func Get(w http.ResponseWriter, r *http.Request) (interface{}, int)

func GetParticular

func GetParticular(w http.ResponseWriter, r *http.Request) (interface{}, int)

func KeyCreate

func KeyCreate(w rest.ResponseWriter, r *rest.Request)

func KeyDelete

func KeyDelete(w rest.ResponseWriter, r *rest.Request)

func KeysList

func KeysList(w rest.ResponseWriter, r *rest.Request)

func NewWebApi

func NewWebApi() http.Handler

func Register

func Register(w rest.ResponseWriter, r *rest.Request)

func Save

func Save(w http.ResponseWriter, r *http.Request) (bag interface{}, status int)

func SmartSave

func SmartSave(request *RequestObject, id string) (bag repository.TranslationBag, newLng int)

func Translate

func Translate(w rest.ResponseWriter, r *rest.Request)

func WebIndex

func WebIndex(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebIndexPage

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

func WebLogin

func WebLogin(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebLogout

func WebLogout(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebPanelIndex

func WebPanelIndex(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebPanelKeysDelete

func WebPanelKeysDelete(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebPanelKeysPost

func WebPanelKeysPost(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebRegister

func WebRegister(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebRegisterGet

func WebRegisterGet(w http.ResponseWriter, r *http.Request, ctx *WebContext) (err error)

func WebRouter

func WebRouter(u *repository.UserRepository, session sessions.Store) http.Handler

Types

type Action

type Action func(w http.ResponseWriter, r *http.Request) (interface{}, int)

type RequestObject

type RequestObject struct {
	Id     string   `json:"id"`
	Text   string   `json:"text"`
	Lang   []string `json:"lang"`
	Source string   `json:"source"`
}

type UserMiddleware

type UserMiddleware struct {
}

func (*UserMiddleware) MiddlewareFunc

func (mw *UserMiddleware) MiddlewareFunc(h rest.HandlerFunc) rest.HandlerFunc

type WebAction

type WebAction func(w http.ResponseWriter, r *http.Request, ctx *WebContext) error

func (WebAction) ServeHTTP

func (a WebAction) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WebContext

type WebContext struct {
	Session *sessions.Session
	User    *domain.User
	CSRF    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL