aboutsummaryrefslogtreecommitdiff
path: root/contact.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-10 16:39:12 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-10 16:39:12 +0100
commit26006592a75df616eed5f9214348c94687991f8d (patch)
tree2f529b3ca2532cc1b88568822457de5edc962ef9 /contact.go
parent32215b65656e77c2064fd0f0318bbc30ca96ce29 (diff)
Add helper contact
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 }