record

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2016 License: BSD-3-Clause Imports: 29 Imported by: 2

Documentation

Overview

Package identicon creates simple visual hashes of data as PNGs.

For more information, see https://en.wikipedia.org/wiki/Identicon and https://github.com/blog/1586-identicons

Index

Constants

View Source
const CSVNewLine = "\n"
View Source
const CSVSep = "|"
View Source
const DirPerm os.FileMode = 0755

Variables

This section is empty.

Functions

func GetCSVContent added in v0.4.0

func GetCSVContent(csvFile string) [][]string

Types

type Record

type Record struct {
	Path    string    // idx 0
	ModTime time.Time // idx 1
	Width   int       // idx 2
	Height  int       // idx 3
	// contains filtered or unexported fields
}

func NewRecord

func NewRecord(pattern string, csv ...string) (Record, error)

func NewRecordFields

func NewRecordFields(pattern, path string, width, height int) Record

func (*Record) CodecDecodeSelf

func (x *Record) CodecDecodeSelf(d *codec1978.Decoder)

func (*Record) CodecEncodeSelf

func (x *Record) CodecEncodeSelf(e *codec1978.Encoder)

func (Record) CreateContent

func (r Record) CreateContent(f string, w io.Writer)

func (Record) CreateFile

func (r Record) CreateFile(basePath string) error

func (Record) FileExt

func (r Record) FileExt() string

func (Record) ToJSON

func (r Record) ToJSON(w io.Writer) error

func (Record) Write

func (r Record) Write(w io.Writer) error

type Renderer added in v0.3.0

type Renderer interface {
	// Render generates an image from data
	Render(data []byte) image.Image
}

Renderer allows rendering of data as a PNG identicon

func New5x5 added in v0.3.0

func New5x5(key []byte) Renderer

New5x5 creates a new 5-by-5 identicon renderer using 'key' as the hash salt

func New7x7 added in v0.3.0

func New7x7(key []byte) Renderer

New7x7 creates a new 7-by-7 identicon renderer using 'key' as the hash salt

func New7x7Size added in v0.3.0

func New7x7Size(sqSize, maxX, maxY, borderX, borderY int, key []byte) Renderer

Jump to

Keyboard shortcuts

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