File size: 503 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
package nfymsg
import "github.com/target/goalert/gadb"
// A Message contains information that can be provided
// to a user for notification.
type Message interface {
MsgID() string
DestType() string
DestArg(name string) string
}
type Base struct {
ID string
Dest gadb.DestV1
}
func (b Base) MsgID() string { return b.ID }
func (b Base) DestType() string { return b.Dest.Type }
func (b Base) DestArg(name string) string {
if b.Dest.Args == nil {
return ""
}
return b.Dest.Args[name]
}
|