inter

package
v0.1.0-rc Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 4 Imported by: 43

Documentation

Index

Constants

View Source
const RequestBodyDecoder = "request_body_decoder"

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	AppReader

	// GetE the service container
	Container() *Container

	// Set the service container
	SetContainer(container Container)

	// Register a shared binding in the container.
	Singleton(abstract interface{}, concrete interface{})

	// Register an existing instance as shared in the container.
	Bind(abstract interface{}, concrete interface{})

	// Register 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) Logger
}

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 Bindings

type Bindings map[string]interface{}

type BootServiceProvider

type BootServiceProvider interface {
	Boot(container Container) Container
}

type Bootstrap

type Bootstrap interface {
	Bootstrap(app Container) Container
}

type ConsoleKernel

type ConsoleKernel interface {
}

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 func(request Request) Response

type Encoder

type Encoder interface {
	IsAble(object interface{}) bool
	EncodeThrough(app App, object interface{}, encoders []Encoder) (string, error)
}

type HttpKernel

type HttpKernel interface {
	Handle(request *http.Request) http.ResponseWriter
}

type HttpMiddleware

type HttpMiddleware interface {
	Handle(request Request, next Next) Response
}

type JsonReader

type JsonReader interface {
	Json() interface{}
}

type Logger

type Logger interface {
	SetApp(app AppReader) Logger
	Clear()
	Group(group string) Logger
	Log(severity log_level.Level, message string, arguments ...interface{})
	LogWith(severity log_level.Level, message string, data interface{})
	Emergency(message string, arguments ...interface{})
	EmergencyWith(message string, data interface{})
	Alert(message string, arguments ...interface{})
	AlertWith(message string, data interface{})
	Critical(message string, arguments ...interface{})
	CriticalWith(message string, data interface{})
	Error(message string, arguments ...interface{})
	ErrorWith(message string, data interface{})
	Warning(message string, arguments ...interface{})
	WarningWith(message string, data interface{})
	Notice(message string, arguments ...interface{})
	NoticeWith(message string, data interface{})
	Info(message string, arguments ...interface{})
	InfoWith(message string, data interface{})
	Debug(message string, arguments ...interface{})
	DebugWith(message string, data interface{})
}

type MapMethodRoutes

type MapMethodRoutes map[string][]Route

type Next

type Next = Controller

type RegisterServiceProvider

type RegisterServiceProvider interface {
	Register(container Container) Container
}

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 ResponseDecorator interface {
	Decorate(response Response) Response
}

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 {
	SetContainer(container Container)
	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 RouteDecorator interface {
	Decorate(route Route) Route
}

type RouteOptions

type RouteOptions interface {
	Prefixes() []string
	Status() int
}

type Rule

type Rule interface {
	Verify(value support.Value) error
}

type RuleWithApp

type RuleWithApp interface {
	Rule
	SetApp(app AppReader) Rule
}

type RuleWithRequirements

type RuleWithRequirements interface {
	Rule
	Requirements() []Rule
}

type TemplateBuilder

type TemplateBuilder = func(template *template.Template) (*template.Template, error)

type View

type View interface {
	Template() string
}

Jump to

Keyboard shortcuts

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