Referenceable: explain a bit more of the whys

This commit is contained in:
Adrien Delorme 2020-11-04 13:20:05 +01:00
parent 10eb32d29e
commit fd873b8811
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,8 @@ package addrs
// Referenceable is an interface implemented by all address types that can // Referenceable is an interface implemented by all address types that can
// appear as references in configuration language expressions. // appear as references in configuration language expressions.
type Referenceable interface { type Referenceable interface {
// referenceableSigil is private to ensure that all Referenceables are
// implentented in this current package. For now this does nothing.
referenceableSigil() referenceableSigil()
// String produces a string representation of the address that could be // String produces a string representation of the address that could be
@ -11,6 +13,8 @@ type Referenceable interface {
String() string String() string
} }
// referenceable is an empty struct that implements Referenceable, add it to
// your Referenceable struct so that it can be recognized as such.
type referenceable struct { type referenceable struct {
} }