aboutsummaryrefslogtreecommitdiff
path: root/contact.go
diff options
context:
space:
mode:
Diffstat (limited to 'contact.go')
-rw-r--r--contact.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/contact.go b/contact.go
new file mode 100644
index 0000000..ea0b780
--- /dev/null
+++ b/contact.go
@@ -0,0 +1,13 @@
+package acme
+
+import "encoding"
+
+type Mail string
+type Phone string
+
+type Contact interface {
+ encoding.TextMarshaler
+}
+
+func (m Mail) MarshalText() ([]byte, error) { return []byte("mailto:" + m), nil }
+func (ph Phone) MarshalText() ([]byte, error) { return []byte("tel:" + ph), nil }