Starting with mail functionality

This commit is contained in:
Eike Kettner
2020-01-05 23:23:28 +01:00
parent 2e3454c7a1
commit f235f3a030
14 changed files with 853 additions and 56 deletions

View File

@ -0,0 +1,60 @@
module Data.SSLType exposing
( SSLType(..)
, all
, fromString
, label
, toString
)
type SSLType
= None
| SSL
| StartTLS
all : List SSLType
all =
[ None, SSL, StartTLS ]
toString : SSLType -> String
toString st =
case st of
None ->
"none"
SSL ->
"ssl"
StartTLS ->
"starttls"
fromString : String -> Maybe SSLType
fromString str =
case String.toLower str of
"none" ->
Just None
"ssl" ->
Just SSL
"starttls" ->
Just StartTLS
_ ->
Nothing
label : SSLType -> String
label st =
case st of
None ->
"None"
SSL ->
"SSL/TLS"
StartTLS ->
"StartTLS"