utils

package
v0.0.0-...-851e7b8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrintInfoColor is information color
	PrintInfoColor = "\033[1;34m%s\033[0m"

	// PrintNoticeColor is notice color
	PrintNoticeColor = "\033[1;36m%s\033[0m"

	// PrintWarningColor is warning color
	PrintWarningColor = "\033[1;33m%s\033[0m"

	// PrintErrorColor is error color
	PrintErrorColor = "\033[1;31m%s\033[0m"

	// PrintDebugColor is debug color
	PrintDebugColor = "\033[0;36m%s\033[0m"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer struct{}

Printer is print color tool

func (*Printer) Println

func (p *Printer) Println(color string, text string)

Println is defined to print text with colored single

type Random

type Random struct{}

Random is a tool to generate chars in random

func (*Random) AutoGeneratePassword

func (r *Random) AutoGeneratePassword(password string) (string, string)

AutoGeneratePassword is defined to create a password with some salts and md5 result returned 返回md5后的password 和用于加盐的salt 如果提供的参数password为空密码生成为随机

func (*Random) MD5

func (r *Random) MD5(text string) string

MD5 is defined to create a md5 char for string data

func (*Random) RandStringBytesMask

func (r *Random) RandStringBytesMask(n int) string

RandStringBytesMask is defined to ramdom strings in bytes n is defind as length

Jump to

Keyboard shortcuts

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