mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
minor: add iris.Singleton as a helper
This commit is contained in:
parent
10fd39fc07
commit
3c79c4ee04
|
@ -852,3 +852,10 @@ func (cwp *ContextWriterPatches) Markdown(patchFunc func(ctx Context, v []byte,
|
|||
func (cwp *ContextWriterPatches) YAML(patchFunc func(ctx Context, v interface{}, indentSpace int) error) {
|
||||
context.WriteYAML = patchFunc
|
||||
}
|
||||
|
||||
// Singleton is a structure which can be used as an embedded field on
|
||||
// struct/controllers that should be marked as singletons on `PartyConfigure` or `MVC` Applications.
|
||||
type Singleton struct{}
|
||||
|
||||
// Singleton returns true as this controller is a singleton.
|
||||
func (c Singleton) Singleton() bool { return true }
|
||||
|
|
Loading…
Reference in New Issue
Block a user