Documentation
¶
Overview ¶
Package app contains core structures for building flotilla applications: App, Configuration, and Environment. Additionally, package app provides management of key application functions through Environment: determination of operation mode, creation of state, logging, and management of extensions. App Configuration Environment
- Mode
- State
- Logging
- Extensions
Index ¶
- Variables
- func BuiltInExtension(a *App) extension.Extension
- func ModeIs(s state.State, is string) bool
- func Stored(s state.State) store.Store
- func StoredString(s state.State, key string) string
- type App
- type Config
- type ConfigFn
- type Configuration
- type Environment
- type Logr
- type Modr
- type RequestFiles
- type StateMakerFn
- type Statr
Constants ¶
This section is empty.
Variables ¶
var (
FlotillaPath string
)
Functions ¶
func BuiltInExtension ¶
Provided an App instance, BuiltInExtension returns a default extension.Extension that includes extensions for cookies, responses, and sessions, as well as several assorted App & State dependent extension functions.
func ModeIs ¶
Given State and a string denoting a Mode, ModeIs returns a boolean value for that mode. If mode string is does not exist, returns false.
Types ¶
type App ¶
type App struct {
engine.Engine
Configuration
Environment
blueprint.Blueprints
// contains filtered or unexported fields
}
App is the cxre structure for a flotilla application, implementing the Engine, Configuration, Environment, and Blueprints interfaces.
func Base ¶
Base returns an intialized App with crucial and the provided ConfigurationFns immediately applied.
func New ¶
New returns a default Base initialized App with static directory plus any provided configuration. Note: ConfigurationFn supplied to New are not run until the App is configured. If you need to modify certain base functionality(e.g. custom engine, environment, or blueprints), start with Base instead of New.
type Config ¶
func Assets ¶
Assets returns a ConfigurationFn adding the provided AssetFS to the app Environment Assets.
func DefaultConfig ¶
func Extend ¶
Extend returns a ConfigurationFn that adds the provided extension.Extensions to the app Environment.
type Configuration ¶
type Environment ¶
type Environment interface {
Statr
Logr
Modr
asset.Assets
extension.Extension
session.Sessions
static.Static
store.Store
template.Templates
}
Environment is an interface for central storage and access of crucial app functionality. These include State creation, Logging, and app Mode determination and setting, in addition to package external Assets, Extension, Session, Static, Store, and Templates.
type Logr ¶
Logr is an interface to logging that implements flotilla/log.Logger as well as swap method for changing the Logger when needed.
type Modr ¶
Modr is an interface for managing any number of modes.
func DefaultModr ¶
func DefaultModr() Modr
DefaultModr returns a default Modr to manage Development, Production, and Testing modes.
type RequestFiles ¶
type RequestFiles map[string][]*multipart.FileHeader
RequestFiles is a map keyed to string containing values of array of mulitpart.FileHeader.
func Files ¶
func Files(s state.State) RequestFiles
Files extracts uploaded files from http.Request, specifically though request.MultipartForm.File.
type StateMakerFn ¶
A StateMakerFn is a function type taking an App instance, and providing a state.Make function.

