mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 18:17:03 +00:00
message: Implement service layer, stubs for #81
I've made some effort to wire the manager into the controllers, but tests are currently failing.
This commit is contained in:
26
pkg/message/message.go
Normal file
26
pkg/message/message.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Package message contains message handling logic.
|
||||
package message
|
||||
|
||||
import (
|
||||
"net/mail"
|
||||
"time"
|
||||
|
||||
"github.com/jhillyerd/enmime"
|
||||
)
|
||||
|
||||
// Metadata holds information about a message, but not the content.
|
||||
type Metadata struct {
|
||||
Mailbox string
|
||||
ID string
|
||||
From *mail.Address
|
||||
To []*mail.Address
|
||||
Date time.Time
|
||||
Subject string
|
||||
Size int64
|
||||
}
|
||||
|
||||
// Message holds both the metadata and content of a message.
|
||||
type Message struct {
|
||||
Metadata
|
||||
Envelope *enmime.Envelope
|
||||
}
|
||||
Reference in New Issue
Block a user