https://github.com/aofei/cameron
An avatar generator for Go.
https://github.com/aofei/cameron
avatar cameron generator go identicon
Last synced: 8 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 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-04T09:11:16.000Z (over 3 years ago)
- Last Synced: 2025-04-13T22:13:01.848Z (8 months ago)
- Topics: avatar, cameron, generator, go, identicon
- Language: Go
- Homepage: https://pkg.go.dev/github.com/aofei/cameron
- Size: 37.1 KB
- Stars: 124
- 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-cn - cameron
- awesome-go - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- awesome-go - aofei/cameron
- awesome-go-plus - cameron - An avatar generator for Go.  (Images / Search and Analytic Databases)
- awesome-go - cameron - An avatar generator for Go. (Images / Advanced Console UIs)
- awesome-go - cameron - An avatar generator for Go. - ★ 9 (Images)
- awesome-go - cameron - | - | - | (Images / Advanced Console UIs)
- awesome-go - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- awesome-go-with-stars - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- fucking-awesome-go - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- awesome-go-zh - cameron
- awesome-go-cn - cameron
- awesome-go - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- awesome-go-extra - cameron - 05-05T22:13:11Z|2022-08-04T09:11:16Z| (Images / Advanced Console UIs)
- awesome-go - cameron - An avatar generator for Go. (Images / Search and Analytic Databases)
- awesome-Char - cameron - An avatar generator for Go. (Images / Advanced Console UIs)
- awesome-go-cn - cameron
- awesome-go - cameron - An avatar generator for Go. (Images / Advanced Console UIs)
README
# Cameron
[](https://github.com/aofei/cameron)
[](https://codecov.io/gh/aofei/cameron)
[](https://goreportcard.com/report/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 main
import (
"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).