mirror of
https://github.com/emersion/go-msgauth
synced 2026-07-03 23:38:33 +00:00
26 lines
485 B
Go
26 lines
485 B
Go
package authres_test
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/emersion/go-msgauth/authres"
|
|
)
|
|
|
|
func Example() {
|
|
// Format
|
|
results := []authres.Result{
|
|
&authres.SPFResult{Value: authres.ResultPass, From: "example.net"},
|
|
&authres.AuthResult{Value: authres.ResultPass, Auth: "sender@example.com"},
|
|
}
|
|
s := authres.Format("example.com", results)
|
|
log.Println(s)
|
|
|
|
// Parse
|
|
identifier, results, err := authres.Parse(s)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
log.Println(identifier, results)
|
|
}
|