store

package
v0.0.0-...-3d35bb9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FriendlyIdLen is the length of any saved posts's filename.
	FriendlyIdLen = 13
)

Variables

This section is empty.

Functions

func Generate62RandomString

func Generate62RandomString(l int) string

Generate62RandomString creates a random string with the given length consisting of characters in [A-Za-z0-9].

func GenerateFriendlyRandomString

func GenerateFriendlyRandomString(l int) string

GenerateFriendlyRandomString creates a random string of characters with the given length consististing of characters in [a-z0-9].

func GenerateRandomString

func GenerateRandomString(dictionary string, l int) string

GenerateRandomString creates a random string of characters of the given length from the given dictionary of possible characters.

This example generates a hexadecimal string 6 characters long:

GenerateRandomString("0123456789abcdef", 6)

func SavePost

func SavePost(outDir string, post []byte) (string, error)

SavePost writes the given bytes to a file with a randomly generated name in the given directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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