Created
May 18, 2017 12:20
-
-
Save iMega/c29d844f57a0e9e88f97f9ddcfc882a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mail | |
import "time" | |
type From []Mailbox | |
type Sender Mailbox | |
type ReplyTo []Address | |
type To []Address | |
type Cc []Address | |
type Bcc []Address | |
type Address struct { | |
Mailbox Mailbox | |
Group group | |
} | |
type Mailbox struct { | |
NameAddr nameAddr | |
AddrSpec addrSpec | |
} | |
type group struct { | |
DisplayName string | |
List []Mailbox | |
} | |
type nameAddr struct { | |
DisplayName string | |
AngleAddr angleAddr | |
} | |
type angleAddr addrSpec | |
type addrSpec string | |
type Date time.Time | |
type Subject string | |
type Comments string | |
type Keywords string | |
func NewNameAddr(DisplayName, AddrSpec string) nameAddr { | |
return nameAddr{ | |
DisplayName: DisplayName, | |
AngleAddr: angleAddr(AddrSpec), | |
} | |
} | |
func NewAddrSpec(AddrSpec string) addrSpec { | |
return addrSpec(AddrSpec) | |
} | |
func NewGroup(DisplayName string, m []Mailbox) group { | |
return group{ | |
DisplayName: DisplayName, | |
List: m, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment