Skip to content
This repository has been archived by the owner on May 6, 2018. It is now read-only.

Create EmailStatus type #19

Open
elimisteve opened this issue Feb 16, 2014 · 3 comments
Open

Create EmailStatus type #19

elimisteve opened this issue Feb 16, 2014 · 3 comments
Assignees

Comments

@elimisteve
Copy link
Member

Should track the status of sending a particular email so we know which ones succeeded and which ones failed. Should include ForeignKey to the email whose status the given EmailStatus "object" is tracking.

@elimisteve elimisteve added this to the MVP: Version 0.1 milestone Feb 16, 2014
@elimisteve
Copy link
Member Author

type EmailStatus struct {
    Email *Email // Not sure which is better
    EmailId string // Not sure which is better
    Status SentStatus // This helps reduce type errors and will remind us to use pre-defined constants
    ...
}

@elimisteve
Copy link
Member Author

What should SentStatus be? Ideas:

type SentStatus string // This is called a "type alias"

const (
    QUEUED SentStatus = "queued"
    SENDING SentStatus = "sending"
    SUCCESS SentStatus = "success"
    FAILED SentStatus = "failed"
)

Another idea:

type SentStatus uint // Another type alias, this time with the `int` type

const (
    QUEUED SentStatus = iota
    SENDING
    SUCCESS
    FAILED
)

See http://golang.org/ref/spec#Iota and the paragraph right before it.

@elimisteve
Copy link
Member Author

Another good iota example: http://golang.org/doc/effective_go.html#constants

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants