utils

package
v0.0.0-...-f5ca578 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CartesianProduct

func CartesianProduct(items [][]string) [][]string

func Permutation

func Permutation(a []string, f func([]string))

Perm calls f with each permutation of a.

func RandFloat

func RandFloat(min, max float64) float64

func RandInt

func RandInt(min int, max int) int

func StringToMD5

func StringToMD5(text string) string

StringToMD5 - Converts a string to md5

func TransformObj

func TransformObj(from interface{}, to interface{}) error

Types

type HashCoder

type HashCoder interface {
	Encode(id int64) string
	Decode(encodedHash string) int64
}

func NewHashCoder

func NewHashCoder(hashSalt string, modelKind ModelKind) HashCoder

type ModelKind

type ModelKind int

ModelKind ...

const (
	Category ModelKind = iota
	Customer
	Product
	User
	Variant
	Store
)

func (ModelKind) String

func (t ModelKind) String() string

Directories

Path Synopsis
Package ring provides a simple ring buffer for storing local data
Package ring provides a simple ring buffer for storing local data

Jump to

Keyboard shortcuts

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