utils

package
v0.0.0-...-16d2632 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentEnvironment string
View Source
var ImageSizes map[string][2]int
View Source
var SuportedMimeTypes map[string][]string

Functions

func Contains

func Contains(stringSlice []string, stringToSearch string) bool

func ContainsKey

func ContainsKey(thisMap interface{}, key string) bool

func CropImage

func CropImage(img io.Reader, imgMimeType string, target string, anchorCoord [2]int) (image.Image, error)

func Decrypt

func Decrypt(encodedData string, secret []byte) (string, error)

Decrypt decrypts encrypt string with a secret key and returns plain string.

func DetectMimeType

func DetectMimeType(file io.Reader) (string, error)

func EncodePassword

func EncodePassword(rawPassword string, salt string) (encodedPassword string)

EncodePassword ...

func Encrypt

func Encrypt(plainData string, secret []byte) (string, error)

Encrypt encrypts plain string with a secret key and returns encrypt string.

func GetRandomString

func GetRandomString(amount int) (randomString string)

GetRandomString ...

func MergeMaps

func MergeMaps(map1 map[string]string, map2 map[string]string) map[string]string

func PBKDF2

func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte

PBKDF2 http://code.google.com/p/go/source/browse/pbkdf2/pbkdf2.go?repo=crypto

func SessionInit

func SessionInit(env string)

SessionInit ...

func UploadImage

func UploadImage(target string, img image.Image) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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