git » spf » commit 8289dc2

README: Extend with convenient links and an usage example

author Alberto Bertogli
2018-03-18 17:10:10 UTC
committer Alberto Bertogli
2018-03-18 17:13:23 UTC
parent 68eb20a756e72bb08f504717a2cbc99761a8e664

README: Extend with convenient links and an usage example

README.md +20 -0

diff --git a/README.md b/README.md
index 52416b9..8f8e28e 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,9 @@
 # blitiri.com.ar/go/spf
 
 [![GoDoc](https://godoc.org/blitiri.com.ar/go/spf?status.svg)](https://godoc.org/blitiri.com.ar/go/spf)
+[![Build Status](https://travis-ci.org/albertito/spf.svg?branch=master)](https://travis-ci.org/albertito/spf)
+[![Go Report Card](https://goreportcard.com/badge/github.com/albertito/spf)](https://goreportcard.com/report/github.com/albertito/spf)
+[![Coverage Status](https://coveralls.io/repos/github/albertito/spf/badge.svg?branch=next)](https://coveralls.io/github/albertito/spf)
 
 [spf](https://godoc.org/blitiri.com.ar/go/spf) is an open source
 implementation of the Sender Policy Framework (SPF) in Go.
@@ -9,6 +12,23 @@ implementation of the Sender Policy Framework (SPF) in Go.
 It is used by the [chasquid](https://blitiri.com.ar/p/chasquid/) SMTP server.
 
 
+## Example
+
+The API is quite simple: it has only one function to perform the SPF check,
+similar to the one suggested in the [RFC](https://tools.ietf.org/html/rfc7208).
+
+```go
+// Check if `ip` is authorized to send email for `domain`.
+result, err := spf.CheckHost(ip, domain)
+if result == spf.Fail {
+	// Not authorized to use the domain.
+}
+```
+
+See the [documentation](https://godoc.org/blitiri.com.ar/go/spf) for more
+details.
+
+
 ## Status
 
 The API should be considered stable. Major version changes will be announced