Documentation ¶
Index ¶
- Constants
- type App
- type AppReader
- type Bindings
- type BootServiceProvider
- type Bootstrap
- type Cache
- type Cli
- type Command
- type Connection
- type ConsoleKernel
- type Container
- type Controller
- type Database
- type Encoder
- type ExitCode
- type HttpKernel
- type HttpMiddleware
- type JsonReader
- type Logger
- type LoggerFacade
- type MapMethodRoutes
- type Next
- type PipeHolder
- type RegisterServiceProvider
- type Request
- type Response
- type ResponseDecorator
- type Route
- type RouteCollection
- type RouteDecorator
- type RouteOptions
- type Rule
- type RuleWithApp
- type RuleWithRequirements
- type TemplateBuilder
- type TypeCast
- type View
Constants ¶
View Source
const ( Short = "short" Flag = "flag" Description = "description" )
View Source
const AppProvider = "app_provider"
View Source
const RequestBodyDecoder = "request_body_decoder"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { AppReader // Container returns the service container Container() *Container // SetContainer set the service container SetContainer(container Container) // Singleton registered a shared binding in the container. Singleton(abstract interface{}, concrete interface{}) // Bind registered an existing instance as shared in the container. Bind(abstract interface{}, concrete interface{}) // Instance registered an existing instance as shared in the container without an abstract Instance(concrete interface{}) interface{} Environment() (string, error) IsEnvironment(environments ...string) bool // The Log method gives you an instance of a logger. You can write your log // messages to this instance. Log(channels ...string) LoggerFacade // Db returns the database facade. If no parameters are provided, it will use // the default connection. Db(connection ...string) Database }
type AppReader ¶
type AppReader interface { // MakeE the given type from the container. Make(abstract interface{}) interface{} // MakeE the given type from the container. MakeE(abstract interface{}) (interface{}, error) }
type BootServiceProvider ¶
type Cli ¶ added in v0.2.1
type Cli interface { App() App Writer() io.Writer WriterErr() io.Writer Ask(label string) string Secret(label string) string Confirm(label string, defaultValue bool) bool Choice(label string, items ...string) string Line(format string, arguments ...interface{}) Comment(format string, arguments ...interface{}) Info(format string, arguments ...interface{}) Error(format string, arguments ...interface{}) Table() table.Writer }
type Connection ¶ added in v0.3.0
type ConsoleKernel ¶
type ConsoleKernel interface {
Handle() ExitCode
}
type Container ¶
type Container interface { AppReader // Register a shared binding in the container. Singleton(abstract interface{}, concrete interface{}) // Register an existing instance as shared in the container with an abstract Bind(abstract interface{}, concrete interface{}) // Register an existing instance as shared in the container without an abstract Instance(concrete interface{}) interface{} // GetE the container's bindings. Bindings() Bindings // Determine if the given abstract type has been bound. Bound(abstract string) bool // "Extend" an abstract type in the container. Extend(abstract interface{}, function func(service interface{}) interface{}) }
type Controller ¶
type Controller = PipeHolder
type Database ¶ added in v0.3.0
type Database interface { Connection() Connection Exec(sql string, args ...interface{}) sql.Result ExecE(sql string, args ...interface{}) (sql.Result, error) Query(sql string, args ...interface{}) support.Collection QueryE(sql string, args ...interface{}) (support.Collection, error) }
type HttpKernel ¶
type HttpMiddleware ¶
type JsonReader ¶
type JsonReader interface {
Json() interface{}
}
type Logger ¶
type Logger interface { SetApp(app AppReader) Logger Clear() bool Group(group string) Logger Log(severity log_level.Level, message string, arguments ...interface{}) LogWith(severity log_level.Level, message string, data interface{}) }
Logger This interface is the interface you should use to add a logger yourself.
type LoggerFacade ¶
type LoggerFacade interface { SetApp(app AppReader) LoggerFacade Group(group string) LoggerFacade Log(severity log_level.Level, message string, arguments ...interface{}) LogWith(severity log_level.Level, message string, data interface{}) // Emergency Log that the system is unusable Emergency(message string, arguments ...interface{}) // EmergencyWith Log that the system is unusable EmergencyWith(message string, data interface{}) // Alert A condition that should be corrected immediately. Alert(message string, arguments ...interface{}) // AlertWith A condition that should be corrected immediately. AlertWith(message string, data interface{}) // Critical conditions Critical(message string, arguments ...interface{}) // CriticalWith Critical conditions CriticalWith(message string, data interface{}) // Error conditions Error(message string, arguments ...interface{}) // ErrorWith Error conditions ErrorWith(message string, data interface{}) // Warning conditions Warning(message string, arguments ...interface{}) // WarningWith Warning conditions WarningWith(message string, data interface{}) // Notice Normal but significant conditions // Conditions that are not error conditions, but that may require special handling. Notice(message string, arguments ...interface{}) // NoticeWith Normal but significant conditions // Conditions that are not error conditions, but that may require special handling. NoticeWith(message string, data interface{}) // Info Informational messages Info(message string, arguments ...interface{}) // InfoWith Informational messages InfoWith(message string, data interface{}) // Debug Debug-level messages // Messages containing information that is normally only useful when debugging a program. Debug(message string, arguments ...interface{}) // DebugWith Debug-level messages // Messages containing information that is normally only useful when debugging a program. DebugWith(message string, data interface{}) }
LoggerFacade This interface ensures that the loggers can be used with the convenient leveling methods. That while the concrete logger only needs to implement inter.Logger.
type MapMethodRoutes ¶
type Next ¶
type Next = PipeHolder
type PipeHolder ¶
type RegisterServiceProvider ¶
type Request ¶
type Request interface { App() App SetApp(app App) Make(abstract interface{}) interface{} MakeE(abstract interface{}) (interface{}, error) Body() string SetBody(body string) Request Source() http.Request Header(key string) string Headers() http.Header Cookie(key string) string CookieE(key string) (string, error) File(key string) support.File FileE(key string) (support.File, error) Files(key string) []support.File FilesE(key string) ([]support.File, error) Method() string Path() string Url() string FullUrl() string Content(key ...string) support.Value ContentE(keyInput ...string) (support.Value, error) ContentOr(keys string, defaultValue interface{}) support.Value Parameter(key string) support.Value ParameterE(key string) (support.Value, error) ParameterOr(key string, defaultValue interface{}) support.Value SetUrlValues(vars map[string]string) Request Query(key string) support.Value QueryE(key string) (support.Value, error) QueryOr(key string, defaultValue interface{}) support.Value Route() Route }
type Response ¶
type Response interface { App() App SetApp(app App) GetContent() interface{} Content(content interface{}) GetBody() string GetBodyE() (string, error) Body(body string) Response GetStatus() int Status(status int) Response GetHeader(key string) string GetHeaders() http.Header Header(key string, values ...string) Response Headers(headers http.Header) Response Cookie(cookies ...http.Cookie) Response GetCookies() []http.Cookie Filename(filename string) Response ShowInBrowser() Response }
type ResponseDecorator ¶
type Route ¶
type Route interface { Uri() string SetUri(url string) Route Method() string Controller() Controller SetPrefix(prefix string) Route SetDestination(destination string) Route SetStatus(status int) Route RouteOptions() RouteOptions Constraint() map[string]string SetConstraint(parameter string, regex string) Route Domain() string SetDomain(domain string) Route Name() string SetName(name string) Route Named(pattern ...string) bool Middleware() []HttpMiddleware SetMiddleware(middlewares []HttpMiddleware) Route SetExcludeMiddleware(middlewares []HttpMiddleware) Route }
type RouteCollection ¶
type RouteCollection interface { Push(route Route) RouteCollection Merge(routeCollections RouteCollection) RouteCollection All() []Route Match(request Request) Route Where(parameter, regex string) RouteCollection WhereMulti(constraints map[string]string) RouteCollection Domain(domain string) RouteCollection Prefix(prefix string) RouteCollection Name(name string) RouteCollection Middleware(...HttpMiddleware) RouteCollection WithoutMiddleware(...HttpMiddleware) RouteCollection }
type RouteDecorator ¶
type RouteOptions ¶
type RuleWithApp ¶
type RuleWithRequirements ¶
type TemplateBuilder ¶
type TypeCast ¶ added in v0.3.0
type TypeCast func(ct sql.ColumnType, raw []byte) interface{}
Click to show internal directories.
Click to hide internal directories.