updated docs

master
Charles Iliya Krempeaux 2017-02-06 13:04:29 -08:00
parent c38ee02a49
commit 4bd4e6ca41
2 changed files with 64 additions and 1 deletions

View File

@ -1,8 +1,38 @@
# go-errhttp # go-errhttp
Package **errhttp** provides types errors that make dealing with HTTP response errors easier. Package **errhttp** provides types errors that make dealing with HTTP response errors easier, for the Go programming language.
## Example
```go
import "github.com/reiver/go-errhttp"
// ...
if err := something(); nil != err {
return errhttp.BadRequestWrap(err)
}
// ...
switch err.(type) {
case errhttp.BadRequest:
//@TODO
case errhttp.NotFound:
//@TODO
case errhtp.InternalServerError:
//@TODO
case errhtp.ClientError:
//@TODO
case errhtp.ServerError:
//@TODO
default:
//@TODO
}
```
## Documention ## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-errhttp Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-errhttp

33
doc.go 100644
View File

@ -0,0 +1,33 @@
/*
Package errhttp provides types errors that make dealing with HTTP response errors easier.
Example
import "github.com/reiver/go-errhttp"
// ...
if err := something(); nil != err {
return errhttp.BadRequestWrap(err)
}
// ...
switch err.(type) {
case errhttp.BadRequest:
//@TODO
case errhttp.NotFound:
//@TODO
case errhtp.InternalServerError:
//@TODO
case errhtp.ClientError:
//@TODO
case errhtp.ServerError:
//@TODO
default:
//@TODO
}
*/
package errhttp