generator

package
v0.0.0-...-e31cc93 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	Generate(f filer.File) string
}

Generator defines an interface for generating file names for files

type MD5Generator

type MD5Generator struct {
}

MD5Generator genrates the md5 sum of a file name

func NewMD5Generator

func NewMD5Generator() *MD5Generator

NewMD5Generator returns an instance of an MD5Generator

func (*MD5Generator) Generate

func (m *MD5Generator) Generate(f filer.File) string

type RandomGenerator

type RandomGenerator struct {
	// contains filtered or unexported fields
}

RandomGenerator generates a random string that can be used as a file name instead of it's original name

func NewRandomGenerator

func NewRandomGenerator(l int) *RandomGenerator

NewRandomGenerator returns an instance of a RandomGenerator If length is less than (or equal to) 0, a panic would occur

func (*RandomGenerator) Generate

func (r *RandomGenerator) Generate(f filer.File) string

type SlugGenerator

type SlugGenerator struct{}

SlugGenerator is a generator that slugifies the name of a given file

func NewSlugGenerator

func NewSlugGenerator() *SlugGenerator

NewSlugGenerator returns an instance of a SlugGenerator

func (*SlugGenerator) Generate

func (s *SlugGenerator) Generate(f filer.File) string

Jump to

Keyboard shortcuts

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