mirror of
https://github.com/crazybber/go-pattern-examples.git
synced 2024-11-26 05:36:03 +03:00
30 lines
655 B
Go
30 lines
655 B
Go
package bridge
|
|
|
|
func ExampleCommonSMS() {
|
|
m := NewCommonMessage(ViaSMS())
|
|
m.SendMessage("have a drink?", "bob")
|
|
// Output:
|
|
// send have a drink? to bob via SMS
|
|
}
|
|
|
|
func ExampleCommonEmail() {
|
|
m := NewCommonMessage(ViaEmail())
|
|
m.SendMessage("have a drink?", "bob")
|
|
// Output:
|
|
// send have a drink? to bob via Email
|
|
}
|
|
|
|
func ExampleUrgencySMS() {
|
|
m := NewUrgencyMessage(ViaSMS())
|
|
m.SendMessage("have a drink?", "bob")
|
|
// Output:
|
|
// send [Urgency] have a drink? to bob via SMS
|
|
}
|
|
|
|
func ExampleUrgencyEmail() {
|
|
m := NewUrgencyMessage(ViaEmail())
|
|
m.SendMessage("have a drink?", "bob")
|
|
// Output:
|
|
// send [Urgency] have a drink? to bob via Email
|
|
}
|