Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aofei/cameron
An avatar generator for Go.
https://github.com/aofei/cameron
avatar cameron generator go identicon
Last synced: 2 months ago
JSON representation
An avatar generator for Go.
- Host: GitHub
- URL: https://github.com/aofei/cameron
- Owner: aofei
- License: mit
- Created: 2018-05-05T22:13:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-04T09:11:16.000Z (over 2 years ago)
- Last Synced: 2024-05-21T18:12:12.081Z (7 months ago)
- Topics: avatar, cameron, generator, go, identicon
- Language: Go
- Homepage: https://pkg.go.dev/github.com/aofei/cameron
- Size: 37.1 KB
- Stars: 116
- Watchers: 6
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- awesome-go - cameron - An avatar generator for Go. - ★ 9 (Images)
- awesome-go-extra - cameron - 05-05T22:13:11Z|2022-08-04T09:11:16Z| (Images / Advanced Console UIs)
- awesome-go-zh - cameron
README
# Cameron
[![GitHub Actions](https://github.com/aofei/cameron/workflows/Test/badge.svg)](https://github.com/aofei/cameron)
[![codecov](https://codecov.io/gh/aofei/cameron/branch/master/graph/badge.svg)](https://codecov.io/gh/aofei/cameron)
[![Go Report Card](https://goreportcard.com/badge/github.com/aofei/cameron)](https://goreportcard.com/report/github.com/aofei/cameron)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/aofei/cameron)](https://pkg.go.dev/github.com/aofei/cameron)An avatar generator for Go.
Oh, by the way, the name of this project came from the
[Avatar](https://en.wikipedia.org/wiki/Avatar_(2009_film))'s director
[James Cameron](https://en.wikipedia.org/wiki/James_Cameron).## Features
* [Identicon](https://en.wikipedia.org/wiki/Identicon)
## Installation
Open your terminal and execute
```bash
$ go get github.com/aofei/cameron
```done.
> The only requirement is the [Go](https://go.dev), at least v1.13.
## Quick Start
Create a file named `cameron.go`
```go
package mainimport (
"bytes"
"image/png"
"net/http""github.com/aofei/cameron"
)func main() {
http.ListenAndServe("localhost:8080", http.HandlerFunc(identicon))
}func identicon(rw http.ResponseWriter, req *http.Request) {
buf := bytes.Buffer{}
png.Encode(&buf, cameron.Identicon([]byte(req.RequestURI), 540, 60))
rw.Header().Set("Content-Type", "image/png")
buf.WriteTo(rw)
}
```and run it
```bash
$ go run cameron.go
```then visit `http://localhost:8080` with different paths.
## Community
If you want to discuss Cameron, or ask questions about it, simply post questions
or ideas [here](https://github.com/aofei/cameron/issues).## Contributing
If you want to help build Cameron, simply follow
[this](https://github.com/aofei/cameron/wiki/Contributing) to send pull requests
[here](https://github.com/aofei/cameron/pulls).## TODOs
* [ ] Add support for cartoon avatar
* [ ] Add support for simulation avatar## License
This project is licensed under the MIT License.
License can be found [here](LICENSE).