https://github.com/gopherlibs/gpic
A Go (Golang) library for using Gravatars within your project.
https://github.com/gopherlibs/gpic
go golang gravatar
Last synced: 3 months ago
JSON representation
A Go (Golang) library for using Gravatars within your project.
- Host: GitHub
- URL: https://github.com/gopherlibs/gpic
- Owner: gopherlibs
- License: mit
- Created: 2020-05-30T15:40:09.000Z (about 6 years ago)
- Default Branch: trunk
- Last Pushed: 2023-08-12T22:04:29.000Z (almost 3 years ago)
- Last Synced: 2026-01-15T07:14:19.916Z (5 months ago)
- Topics: go, golang, gravatar
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gPic Go Module [](https://app.circleci.com/pipelines/github/gopherlibs/gpic) [](https://goreportcard.com/report/github.com/gopherlibs/gpic) [](https://raw.githubusercontent.com/gopherlibs/gpic/master/LICENSE)
`gPic` is a Go (Golang) module that allows you to generate Avatar URLs easily in your own Go project. This currently support Gravatar and GitHub avatars. GitLab support will be added soon.
## Requirements
This Go module is tested with the ~~two~~ most recent minor ~~releases~~ release of Go.
Currently this is Go v1.20.
## Installation
`gPic` is a Go module and so the best way to use it is to import it into your own code and then run `go mod tidy` to get it downloaded.
```go
import(
"github.com/gopherlibs/gpic/gpic"
)
```
## Usage
```go
package main
import (
"fmt"
"github.com/gopherlibs/gpic/gpic"
)
func main() {
img, err := gpic.NewImage("Ricardo@Feliciano.Tech")
if err != nil {
fmt.Println(err)
return
}
imgURL, err := img.URL()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(imgURL.String())
}
```
## Development
This library is written and tested with Go v1.20+ in mind.
`go fmt` is your friend.
Please feel free to open Issues and PRs are you see fit.
Any PR that requires a good amount of work or is a significant change, it would be best to open an Issue to discuss the change first.
## License & Credits
This module was written by Ricardo N Feliciano (FelicianoTech).
This repository is licensed under the MIT license.
This repo's license can be found [here](./LICENSE).