From 3c79c4ee0489e29e859db6457a77a6acaf912570 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 22 Aug 2023 15:06:36 +0300 Subject: [PATCH] minor: add iris.Singleton as a helper --- aliases.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aliases.go b/aliases.go index 49333f2f..54061600 100644 --- a/aliases.go +++ b/aliases.go @@ -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 }