Files
openfsd/postoffice/mail.go
Reese Norris 57d54d6705 v0.1.0-alpha
Changes:
- Implement bootstrapping library for managing several concurrent internal services
- Refactor concurrency model for connections/logical clients and their associated I/O
- Refactor server context singleton
- Refactor error handling
    - Most errors are now gracefully sent to the FSD client directly encoded as an $ER packet,
      enhancing visibility and debugging
    - Most errors are now rightfully treated as non-fatal
- Refactor package/dependency graph
- Refactor calling conventions/interfaces for many packages
- Refactor database package
- Refactor post office

Features:
- Add VATSIM-esque HTTP/JSON "data feed"
- Add ephemeral in-memory database option
- Add user management REST API
- Add improved web interface
- Add MySQL support (drop SQLite support)
2024-10-07 12:50:39 -07:00

44 lines
743 B
Go

package postoffice
// Mail types
const (
MailTypeDirect = iota
MailTypeBroadcast
MailTypeGeneralProximityBroadcast
MailTypeCloseProximityBroadcast
MailTypeSupervisorBroadcast
)
// Mail represents a message to be passed between addresses
type Mail struct {
mailType int
source Address
recipient string
packet string
}
func (m *Mail) Type() int {
return m.mailType
}
func (m *Mail) Source() Address {
return m.source
}
func (m *Mail) Recipient() string {
return m.recipient
}
func (m *Mail) Packet() string {
return m.packet
}
func NewMail(source Address, mailType int, recipient string, packet string) Mail {
return Mail{
mailType: mailType,
source: source,
recipient: recipient,
packet: packet,
}
}