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.
This Go module is tested with the two most recent minor releases release of Go.
Currently this is Go v1.20.
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.
import(
"github.com/gopherlibs/gpic/gpic"
)
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())
}
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.
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.