Skip to content

Commit 3c79c4e

Browse files
committed
minor: add iris.Singleton as a helper
1 parent 10fd39f commit 3c79c4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

aliases.go

+7
Original file line numberDiff line numberDiff line change
@@ -852,3 +852,10 @@ func (cwp *ContextWriterPatches) Markdown(patchFunc func(ctx Context, v []byte,
852852
func (cwp *ContextWriterPatches) YAML(patchFunc func(ctx Context, v interface{}, indentSpace int) error) {
853853
context.WriteYAML = patchFunc
854854
}
855+
856+
// Singleton is a structure which can be used as an embedded field on
857+
// struct/controllers that should be marked as singletons on `PartyConfigure` or `MVC` Applications.
858+
type Singleton struct{}
859+
860+
// Singleton returns true as this controller is a singleton.
861+
func (c Singleton) Singleton() bool { return true }

0 commit comments

Comments
 (0)