Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvironmentNames = map[Environment]string{ EnvUnknown: "unknown", EnvProduction: "production", EnvStaging: "staging", EnvDevTest: "dev", EnvLocal: "local", }
EnvironmentNames is mapping of environment codes to environment names
Functions ¶
func AddHTTPHandler ¶
func AddHTTPHandler(pattern string, handler func(http.ResponseWriter, *http.Request))
AddHTTPHandler adds http handler with / suffix TODO: mark as deprecated?
Types ¶
type AppContext ¶
type AppContext interface { }
AppContext is app context for an app Deprecated: use AppUserSettings instead
type AppUser ¶
type AppUser interface { SetPreferredLocale(code5 string) error GetPreferredLocale() string SetNames(first, last, user string) }
AppUser defines app user interface
type AppUserBase ¶
type AppUserBase struct { DtCreated time.Time user.AccountsOfUser Locale string `datastore:",noindex"` FirstName string `datastore:",noindex"` LastName string `datastore:",noindex"` UserName string `datastore:",noindex"` }
AppUserBase hold common properties for AppUser interface
func (*AppUserBase) GetFullName ¶
func (u *AppUserBase) GetFullName() string
func (*AppUserBase) GetPreferredLocale ¶
func (u *AppUserBase) GetPreferredLocale() string
GetPreferredLocale gets preferred locale
func (*AppUserBase) SetNames ¶
func (u *AppUserBase) SetNames(first, last, user string)
SetNames sets names
func (*AppUserBase) SetPreferredLocale ¶
func (u *AppUserBase) SetPreferredLocale(v string) error
SetPreferredLocale sets preferred locale
type AppUserSettings ¶ added in v0.3.1
AppUserSettings is app user record setup for an app
type DefaultHttpAppHost ¶ added in v0.2.0
type DefaultHttpAppHost struct { }
func (DefaultHttpAppHost) GetEnvironment ¶ added in v0.2.0
func (d DefaultHttpAppHost) GetEnvironment(c context.Context, r *http.Request) Environment
func (DefaultHttpAppHost) HandleWithContext ¶ added in v0.2.0
func (d DefaultHttpAppHost) HandleWithContext(handler HttpHandlerWithContext) func(w http.ResponseWriter, r *http.Request)
type Environment ¶
type Environment int8
Environment defines environment
const ( // EnvUnknown is unknown environment EnvUnknown Environment = iota // EnvProduction is production environment EnvProduction // EnvStaging is staging environment EnvStaging // EnvDevTest is developers test environment EnvDevTest // EnvLocal is developer's local environment EnvLocal )
type ExecutionContext ¶
ExecutionContext is execution context for UI app Contains translator and context.Context
func NewExecutionContext ¶
func NewExecutionContext(c context.Context) ExecutionContext
NewExecutionContext creates new execution context
type HttpAppHost ¶ added in v0.1.0
type HttpAppHost interface { GetEnvironment(c context.Context, r *http.Request) Environment HandleWithContext(handler HttpHandlerWithContext) func(w http.ResponseWriter, r *http.Request) }
type HttpHandlerWithContext ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.