From 10ca4f46717670108d6cd7a3fecd457572f69cf0 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 5 Feb 2025 16:49:27 -0500 Subject: [PATCH] Add "named" actor interface --- actor.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/actor.go b/actor.go index b9ad25e..90418eb 100644 --- a/actor.go +++ b/actor.go @@ -29,6 +29,14 @@ type Actor interface { Type() string } +// Named is any object with a name. +type Named() string { + // Name returns the name. This doesn't need to be the same as Type. It + // must return the same string every time. It is used to differentiate + // actors of the same type in logs. + Name() string +} + // FlagAdder is any object that can add [Flag]s to a [FlagSet]. Actors which // implement this interface will be called upon to add flags during and only // during the flag parsing phase.