From 06f3e498f07103bfd0595cf5b8fc41c8f983e542 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sat, 2 May 2015 15:34:29 -0700 Subject: [PATCH] physical: Adding optional interface for addr detection --- physical/physical.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/physical/physical.go b/physical/physical.go index 404ad281e..2a40670a0 100644 --- a/physical/physical.go +++ b/physical/physical.go @@ -32,6 +32,14 @@ type HABackend interface { LockWith(key, value string) (Lock, error) } +// AdvertiseDetect is an optional interface that an HABackend +// can implement. If they do, an advertise address can be automatically +// detected. +type AdvertiseDetect interface { + // DetectHostAddr is used to detect the host address + DetectHostAddr() (string, error) +} + type Lock interface { // Lock is used to acquire the given lock // The stopCh is optional and if closed should interrupt the lock