Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ferhatelmas/httpclass
Get class of a HTTP code
https://github.com/ferhatelmas/httpclass
Last synced: 26 days ago
JSON representation
Get class of a HTTP code
- Host: GitHub
- URL: https://github.com/ferhatelmas/httpclass
- Owner: ferhatelmas
- License: mit
- Created: 2015-12-11T11:53:10.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-11T15:10:55.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T11:10:16.558Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
## httpclass
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/ferhatelmas/httpclass)
[![Build Status](https://travis-ci.org/ferhatelmas/httpclass.png?branch=master)](https://travis-ci.org/ferhatelmas/httpclass)> Returns the class of a HTTP status code.
### Install
```
go get github.com/ferhatelmas/httpclass
```### Usage
```go
import "github.com/ferhatelmas/httpclass"httpclass.Get(http.StatusOK)
//=> httpclass.Success, nilhttpclass.Get(http.StatusBadRequest)
//=> httpclass.ClientError, nilhttpclass.Get(0)
//=> Informational, "Wrong status code 0"
```### License
MIT © [ferhat elmas](http://ferhatelmas.com)