avatar

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 3 Imported by: 0

README

integrador-avatar-me

Esto es el trabajo integrador de conceptos básicos del curso de Golang. El mismo es un módulo que genera un identicon único para cada usuario en base a una información del mismo.

Explicación de su uso

Para su uso debe crearse una estructura tipo Info, la cual contendrá la información de la cual se obtendrá un hash y la dirección donde se guardará la imagen generada. A continuación se encuentra un ejemplo.

package main

import (
	"fmt"

	"github.com/AtilioBoher/integrador-avater-me"
)

func main() {
	info := avatar.Info{
		StrInfo:  "someName",
		FilePath: "identicon.png",
	}

	a := avatar.GimmeAnAvatarGenerator()
	err := a.GenerateAndSaveAvatar(info)
	if err != nil {
		fmt.Println(err)
	}

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GimmeAnAvatarGenerator

func GimmeAnAvatarGenerator() *avatarGenerator

Returns the pointer to an avatar generator

Types

type Info

type Info struct {
	StrInfo  string
	FilePath string
}

Info can contain the information related to the generation of an avatar. StrInfo contains the string that is going to be hashed to ganerate the avatar, and FilePath is the path where the avatar will be stored (the image format must be .png)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL