Add "named" actor interface

This commit is contained in:
Sasha Koshka 2025-02-05 16:49:27 -05:00
parent e0c8825949
commit 10ca4f4671

View File

@ -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.