Skip to content

A Go (Golang) library for using Gravatars within your project.

License

Notifications You must be signed in to change notification settings

gopherlibs/gpic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gPic Go Module CI Status Go Report Card Software 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.

import(
	"github.com/gopherlibs/gpic/gpic"
)

Usage

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.