Versions in this module Expand all Collapse all v0 v0.11.4 Aug 28, 2018 v0.11.3 Aug 18, 2018 v0.11.2 Jul 28, 2018 v0.11.1 Jul 22, 2018 v0.11.0 Jul 7, 2018 Changes in this version + const EventOnHeaderReply + const EventOnPostReply + const EventOnPostShutdown + const EventOnPreShutdown + const KeyOAuth2Token + const KeyViewArgRequest + var ErrAuthorizationFailed = errors.New("aah: authorization failed") + var ErrNotAuthenticated = errors.New("aah: not authenticated") + var ErrRenderResponse = errors.New("aah: render response error") + var ErrSessionAuthenticationInfo = errors.New("aah: session authentication info") + var ErrUnableToGetPrincipal = errors.New("aah: unable to get principal") + var ErrWriteResponse = errors.New("aah: write response error") + func AddWebSocket(w interface{}, methods []*ainsp.Method) + func AppLog() log.Loggerer + func AppSSLCert() string + func AppSSLKey() string + func AppVFS() *vfs.VFS + func AppVirtualBaseDir() string + func AppWSEngine() *ws.Engine + func OnPostShutdown(ecb EventCallbackFunc, priority ...int) + func OnPreShutdown(ecb EventCallbackFunc, priority ...int) + func SubscribeEventFunc(eventName string, ecf EventCallbackFunc) + func UnsubscribeEventFunc(eventName string, ecf EventCallbackFunc) type Context + func (ctx *Context) RouteURL(routeName string, args ...interface{}) string + func (ctx *Context) RouteURLNamedArgs(routeName string, args map[string]interface{}) string + type HTTPEngine struct + func AppHTTPEngine() *HTTPEngine + func (e *HTTPEngine) Handle(w http.ResponseWriter, r *http.Request) + func (e *HTTPEngine) Log() log.Loggerer + func (e *HTTPEngine) Middlewares(middlewares ...MiddlewareFunc) + func (e *HTTPEngine) OnHeaderReply(sef EventCallbackFunc) + func (e *HTTPEngine) OnPostAuth(sef EventCallbackFunc) + func (e *HTTPEngine) OnPostReply(sef EventCallbackFunc) + func (e *HTTPEngine) OnPreAuth(sef EventCallbackFunc) + func (e *HTTPEngine) OnPreReply(sef EventCallbackFunc) + func (e *HTTPEngine) OnRequest(sef EventCallbackFunc) type Reply + func (r *Reply) FromReader(reader io.Reader) *Reply + func (r *Reply) JSONSecure(data interface{}) *Reply + func (r *Reply) NotAcceptable() *Reply + func (r *Reply) RedirectWithStatus(redirectURL string, code int) *Reply + func (r *Reply) UnsupportedMediaType() *Reply v0.10.1 Apr 24, 2018 Changes in this version + const EventOnPostAuth + const EventOnPreAuth + const KeyViewArgAuthcInfo + const KeyViewArgRequestParams + const KeyViewArgSubject + var ErrAccessDenied = errors.New("aah: access denied") + var ErrAuthenticationFailed = errors.New("aah: authentication failed") + var ErrContentTypeNotAccepted = errors.New("aah: content type not accepted") + var ErrContentTypeNotOffered = errors.New("aah: content type not offered") + var ErrControllerOrActionNotFound = errors.New("aah: controller or action not found") + var ErrDomainNotFound = errors.New("aah: domain not found") + var ErrGeneric = errors.New("aah: generic error") + var ErrHTTPMethodNotAllowed = errors.New("aah: http method not allowed") + var ErrInvalidRequestParameter = errors.New("aah: invalid request parameter") + var ErrPanicRecovery = errors.New("aah: panic recovery") + var ErrRouteNotFound = errors.New("aah: route not found") + var ErrStaticFileNotFound = errors.New("aah: static file not found") + var ErrValidation = errors.New("aah: validation error") + var JSONMarshal func(v interface{}) ([]byte, error) + var JSONMarshalIndent func(v interface{}, prefix, indent string) ([]byte, error) + func ActionMiddleware(ctx *Context, m *Middleware) + func AddLoggerHook(name string, hook log.HookFunc) error + func AddPasswordAlgorithm(name string, encoder acrypto.PasswordEncoder) error + func AddValueParser(typ reflect.Type, parser valpar.Parser) error + func AntiCSRFMiddleware(ctx *Context, m *Middleware) + func AppInstanceName() string + func AppSecurityManager() *security.Manager + func AuthcAuthzMiddleware(ctx *Context, m *Middleware) + func BindMiddleware(ctx *Context, m *Middleware) + func CORSMiddleware(ctx *Context, m *Middleware) + func NewChildLogger(ctx log.Fields) *log.Logger + func OnPostAuth(sef EventCallbackFunc) + func OnPreAuth(sef EventCallbackFunc) + func RouteMiddleware(ctx *Context, m *Middleware) + func SetErrorHandler(handlerFunc ErrorHandlerFunc) + func SetMinifier(fn MinifierFunc) + func SetTLSConfig(tlsCfg *tls.Config) + func Validate(s interface{}) (validator.ValidationErrors, error) + func ValidateValue(v interface{}, rules string) bool + func Validator() *validator.Validate type Context + func (ctx *Context) Get(key string) interface{} + func (ctx *Context) Log() log.Loggerer + func (ctx *Context) Set(key string, value interface{}) + func (ctx *Context) Subdomain() string + func (ctx *Context) Subject() *security.Subject type Data + func (d Data) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type Error struct + Code int + Data interface{} + Message string + Reason error + func (e *Error) Error() string + type ErrorHandler interface + HandleError func(err *Error) bool + type ErrorHandlerFunc func(ctx *Context, err *Error) bool + type MinifierFunc func(contentType string, w io.Writer, r io.Reader) error + type RenderFunc func(w io.Writer) error + func (rf RenderFunc) Render(w io.Writer) error type Reply + func (r *Reply) Error(err *Error) *Reply + func (r *Reply) Render(rdr Render) *Reply v0.5.1 May 21, 2017 Changes in this version + func AddServerTLSConfig(tlsCfg *tls.Config) + func AppDesc() string + func SetAppPackaged(pack bool) + func SubscribeEventf(eventName string, ecf EventCallbackFunc) + type Binary struct + Path string + Reader io.Reader + func (f *Binary) Render(w io.Writer) error type Context + func (ctx *Context) IsStaticRoute() bool type EventCallback + CallOnce bool type Reply + func (r *Reply) Binary(b []byte) *Reply + func (r *Reply) Body() *bytes.Buffer + func (r *Reply) DisableGzip() *Reply + func (r *Reply) FileDownload(file, targetName string) *Reply + func (r *Reply) HTMLf(filename string, data Data) *Reply + func (r *Reply) Readfrom(reader io.Reader) *Reply + func (r *Reply) RedirectSts(redirectURL string, code int) *Reply + func (r *Reply) Reset() v0.4.1 Apr 15, 2017 Changes in this version + const EventOnAfterReply + const EventOnInit + const EventOnPreReply + const EventOnRequest + const EventOnShutdown + const EventOnStart + const Version + func AddController(c interface{}, methods []*MethodInfo) + func AddSessionStore(name string, store session.Storer) error + func AddTemplateFunc(funcs template.FuncMap) + func AddViewEngine(name string, engine view.Enginer) error + func AllAppProfiles() []string + func AppBaseDir() string + func AppConfig() *config.Config + func AppDateFormat() string + func AppDateTimeFormat() string + func AppDefaultI18nLang() string + func AppHTTPAddress() string + func AppHTTPPort() string + func AppI18n() *i18n.I18n + func AppI18nLocales() []string + func AppImportPath() string + func AppIsSSLEnabled() bool + func AppName() string + func AppProfile() string + func AppRouter() *router.Router + func AppSecurity() *security.Security + func AppSessionManager() *session.Manager + func AppViewEngine() view.Enginer + func Init(importPath string) + func Middlewares(middlewares ...MiddlewareFunc) + func OnAfterReply(sef EventCallbackFunc) + func OnInit(ecb EventCallbackFunc, priority ...int) + func OnPreReply(sef EventCallbackFunc) + func OnRequest(sef EventCallbackFunc) + func OnShutdown(ecb EventCallbackFunc, priority ...int) + func OnStart(ecb EventCallbackFunc, priority ...int) + func PublishEvent(eventName string, data interface{}) + func PublishEventSync(eventName string, data interface{}) + func SetAppBuildInfo(bi *BuildInfo) + func SetAppProfile(profile string) error + func Shutdown() + func Start() + func SubscribeEvent(eventName string, ec EventCallback) + func UnsubscribeEvent(eventName string, ec EventCallback) + func UnsubscribeEventf(eventName string, ec EventCallbackFunc) + type BuildInfo struct + BinaryName string + Date string + Version string + func AppBuildInfo() *BuildInfo + type Bytes struct + Data []byte + func (b *Bytes) Render(w io.Writer) error + type Context struct + Req *ahttp.Request + Res ahttp.ResponseWriter + func (ctx *Context) Abort() + func (ctx *Context) AddViewArg(key string, value interface{}) *Context + func (ctx *Context) Cookie(name string) (*http.Cookie, error) + func (ctx *Context) Cookies() []*http.Cookie + func (ctx *Context) Msg(key string, args ...interface{}) string + func (ctx *Context) Msgl(locale *ahttp.Locale, key string, args ...interface{}) string + func (ctx *Context) Reply() *Reply + func (ctx *Context) Reset() + func (ctx *Context) ReverseURL(routeName string, args ...interface{}) string + func (ctx *Context) ReverseURLm(routeName string, args map[string]interface{}) string + func (ctx *Context) Session() *session.Session + func (ctx *Context) SetMethod(method string) + func (ctx *Context) SetURL(pathURL string) + func (ctx *Context) ViewArgs() map[string]interface{} + type Data map[string]interface + type Event struct + Data interface{} + Name string + type EventCallback struct + Callback EventCallbackFunc + PublishOnce bool + type EventCallbackFunc func(e *Event) + type EventCallbacks []EventCallback + func (ec EventCallbacks) Len() int + func (ec EventCallbacks) Less(i, j int) bool + func (ec EventCallbacks) Swap(i, j int) + type EventStore struct + func AppEventStore() *EventStore + func (es *EventStore) IsEventExists(eventName string) bool + func (es *EventStore) Publish(e *Event) + func (es *EventStore) PublishSync(e *Event) + func (es *EventStore) Subscribe(event string, ec EventCallback) + func (es *EventStore) SubscriberCount(eventName string) int + func (es *EventStore) Unsubscribe(event string, callback EventCallbackFunc) + type File struct + Data io.ReadCloser + func (f *File) Render(w io.Writer) error + type HTML struct + Filename string + Layout string + Template *template.Template + ViewArgs Data + func (h *HTML) Render(w io.Writer) error + type JSON struct + Callback string + Data interface{} + IsJSONP bool + func (j *JSON) Render(w io.Writer) error + type MethodInfo struct + Name string + Parameters []*ParameterInfo + type Middleware struct + func (mw *Middleware) Next(ctx *Context) + type MiddlewareFunc func(ctx *Context, m *Middleware) + func ToMiddleware(handler interface{}) MiddlewareFunc + type ParameterInfo struct + Name string + Type reflect.Type + type Render interface + Render func(io.Writer) error + type Reply struct + Code int + ContType string + Hdr http.Header + Rdr Render + func NewReply() *Reply + func (r *Reply) Accepted() *Reply + func (r *Reply) BadRequest() *Reply + func (r *Reply) Bytes(contentType string, data []byte) *Reply + func (r *Reply) Conflict() *Reply + func (r *Reply) ContentType(contentType string) *Reply + func (r *Reply) Cookie(cookie *http.Cookie) *Reply + func (r *Reply) Created() *Reply + func (r *Reply) Done() *Reply + func (r *Reply) File(filename string, file io.ReadCloser) *Reply + func (r *Reply) FileInline(filename string, file io.ReadCloser) *Reply + func (r *Reply) Forbidden() *Reply + func (r *Reply) Found() *Reply + func (r *Reply) HTML(data Data) *Reply + func (r *Reply) HTMLl(layout string, data Data) *Reply + func (r *Reply) HTMLlf(layout, filename string, data Data) *Reply + func (r *Reply) Header(key, value string) *Reply + func (r *Reply) HeaderAppend(key, value string) *Reply + func (r *Reply) InternalServerError() *Reply + func (r *Reply) IsContentTypeSet() bool + func (r *Reply) JSON(data interface{}) *Reply + func (r *Reply) JSONP(data interface{}, callback string) *Reply + func (r *Reply) MethodNotAllowed() *Reply + func (r *Reply) MovedPermanently() *Reply + func (r *Reply) NoContent() *Reply + func (r *Reply) NotFound() *Reply + func (r *Reply) Ok() *Reply + func (r *Reply) Redirect(redirectURL string) + func (r *Reply) Redirects(redirectURL string, code int) + func (r *Reply) ServiceUnavailable() *Reply + func (r *Reply) Status(code int) *Reply + func (r *Reply) TemporaryRedirect() *Reply + func (r *Reply) Text(format string, values ...interface{}) *Reply + func (r *Reply) Unauthorized() *Reply + func (r *Reply) XML(data interface{}) *Reply + type Text struct + Format string + Values []interface{} + func (t *Text) Render(w io.Writer) error + type XML struct + Data interface{} + func (x *XML) Render(w io.Writer) error