From 4bd4e6ca41e4131bc50e3e1b3958cb3c16649cf3 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 6 Feb 2017 13:04:29 -0800 Subject: [PATCH] updated docs --- README.md | 32 +++++++++++++++++++++++++++++++- doc.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 doc.go diff --git a/README.md b/README.md index 540ea03..8f41171 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,38 @@ # 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 Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-errhttp diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..475d94e --- /dev/null +++ b/doc.go @@ -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