server

package
v0.0.0-...-0d86c5e Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestMiddleware

type RequestMiddleware func(r *http.Request)

type ResponseMiddleware

type ResponseMiddleware func(w http.ResponseWriter, r *http.Request) bool

Middleware for server, return true to continue

type Server

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

func NewServer

func NewServer(storage i18n.Storage, middleware ...ResponseMiddleware) *Server

func (*Server) ServeHTTP

func (server *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Storage

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

func NewStorage

func NewStorage(url string, middleware ...RequestMiddleware) *Storage

func (*Storage) DefaultLanguage

func (storage *Storage) DefaultLanguage() (language.Tag, error)

func (*Storage) Delete

func (storage *Storage) Delete(t *i18n.Translation) error

func (*Storage) DeleteSupportedLanguage

func (storage *Storage) DeleteSupportedLanguage(language.Tag) error

func (*Storage) GetAll

func (storage *Storage) GetAll() ([]*i18n.Translation, error)

func (*Storage) SetDefaultLanguage

func (storage *Storage) SetDefaultLanguage(language.Tag) error

func (*Storage) Store

func (storage *Storage) Store(t *i18n.Translation) error

func (*Storage) StoreSupportedLanguage

func (storage *Storage) StoreSupportedLanguage(language.Tag) error

func (*Storage) SupportedLanguages

func (storage *Storage) SupportedLanguages() ([]language.Tag, error)

Jump to

Keyboard shortcuts

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