-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code refactoring. Add avatar generation for username
- Loading branch information
Showing
10 changed files
with
499 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
language: go | ||
go: | ||
- 1.7 | ||
- tip | ||
before_install: | ||
- export PATH=$PATH:$GOPATH/bin | ||
- go get github.com/modocache/gover | ||
- go get github.com/mattn/goveralls | ||
- go get golang.org/x/tools/cmd/cover | ||
install: | ||
- go get -t -v ./... | ||
script: | ||
- diff -u <(echo -n) <(gofmt -d -s $(find . -type f -name '*.go' -not -path "./bindata/*")) | ||
- go test -coverprofile=govatar.coverprofile | ||
- gover | ||
- goveralls -coverprofile=gover.coverprofile -service=travis-ci | ||
matrix: | ||
allow_failures: | ||
- go: tip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# GOvatar | ||
[![License](http://img.shields.io/:license-mit-blue.svg)](LICENSE) | ||
[![GoDoc](https://godoc.org/github.com/o1egl/govatar?status.svg)](https://godoc.org/github.com/o1egl/govatar) | ||
[![Build Status](http://img.shields.io/travis/o1egl/govatar.svg?style=flat-square)](https://travis-ci.org/o1egl/govatar) | ||
[![Coverage Status](http://img.shields.io/coveralls/o1egl/govatar.svg?style=flat-square)](https://coveralls.io/r/o1egl/govatar) | ||
|
||
![GOvatar image](files/avatars.jpg) | ||
|
||
|
@@ -20,32 +23,35 @@ $ go get -u github.com/o1egl/govatar/... | |
## Usage | ||
|
||
```bash | ||
$ govatar generate male -o avatar.png # Generates random avatar.png for male | ||
$ govatar generate female -o avatar.png # Generates random avatar.png for female | ||
$ govatar -h # Display help message | ||
$ govatar generate male -o avatar.png # Generates random avatar.png for male | ||
$ govatar generate female -o avatar.png # Generates random avatar.png for female | ||
$ govatar generate male -u [email protected] -o avatar.png # Generates avatar.png for specified username | ||
$ govatar -h # Display help message | ||
``` | ||
|
||
#### As lib | ||
|
||
Generates avatar and save it to file | ||
Generates avatar and save it to filePath | ||
|
||
```go | ||
govatar.GenerateFile(govatar.MALE, "/path/to/file") | ||
err := govatar.GenerateFile(govatar.MALE, "/path/to/avatar.jpg" | ||
err := govatar.GenerateFileFromUsername(govatar.MALE, "username", "/path/to/avatar.jpg") | ||
```` | ||
|
||
Generates avatar and return it as image.Image | ||
|
||
```go | ||
img, err := govatar.Generate(govatar.MALE) | ||
img, err := govatar.GenerateFromUsername(govatar.MALE, "username") | ||
```` | ||
## Copyright, License & Contributors | ||
### Adding new skins | ||
1. Add new skins to data/background, male/clothes, female/hair and etc... | ||
2. Run ``$ go-bindata -nomemcopy -pkg govatar data/...`` for building embedded assets. | ||
1. Add new skins to background, male/clothes, female/hair and etc... | ||
2. Run ``$ make assets`` for building embedded assets. | ||
3. Submit pull request :) | ||
### Submitting a Pull Request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,7 +340,7 @@ | |
// data/male/mouth/mouth9.png | ||
// DO NOT EDIT! | ||
|
||
package govatar | ||
package bindata | ||
|
||
import ( | ||
"bytes" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.