simple

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

实现简单的三元表达式功能

Index

Constants

View Source
const CODE62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const CodeLength = 62

Variables

View Source
var CodeMap = map[string]int64{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9, "a": 10,
	"b": 11, "c": 12, "d": 13, "e": 14, "f": 15, "g": 16, "h": 17, "i": 18, "j": 19, "k": 20, "l": 21, "m": 22,
	"n": 23, "o": 24, "p": 25, "q": 26, "r": 27, "s": 28, "t": 29, "u": 30, "v": 31, "w": 32, "x": 33, "y": 34,
	"z": 35, "A": 36, "B": 37, "C": 38, "D": 39, "E": 40, "F": 41, "G": 42, "H": 43, "I": 44, "J": 45, "K": 46,
	"L": 47, "M": 48, "N": 49, "O": 50, "P": 51, "Q": 52, "R": 53, "S": 54, "T": 55, "U": 56, "V": 57, "W": 58,
	"X": 59, "Y": 60, "Z": 61}

Functions

func CloseDB

func CloseDB()

CloseDB 关闭连接

func Contains

func Contains(search interface{}, target interface{}) bool

func ContainsIgnoreCase

func ContainsIgnoreCase(search string, target []string) bool

func DB

func DB() *gorm.DB

DB 获取数据库链接

func Decode62

func Decode62(str string) int64

Decode62 *

  • 解码字符串为整数

func Encode62

func Encode62(number int64) string

Encode62 *

  • 编码 整数 为 base62 字符串

func EncodePassword

func EncodePassword(rawPassword string) string

func If

func If(args ...interface{}) interface{}

If - (a ? b : c) Or (a && b)

func MD5

func MD5(str string) string

func MD5Bytes

func MD5Bytes(data []byte) string

func OpenDB

func OpenDB(DbType string, dsn string, TablePrefix string, config *gorm.Config, maxIdleConns, maxOpenConns int, models ...interface{}) (err error)

func Prefix

func Prefix() string

func ValidatePassword

func ValidatePassword(encodePassword, inputPassword string) bool

Types

type UrlBuilder

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

func ParseUrl

func ParseUrl(rawUrl string) *UrlBuilder

func (*UrlBuilder) AddQueries

func (builder *UrlBuilder) AddQueries(queries map[string]string) *UrlBuilder

func (*UrlBuilder) AddQuery

func (builder *UrlBuilder) AddQuery(name, value string) *UrlBuilder

func (*UrlBuilder) Build

func (builder *UrlBuilder) Build() *url.URL

func (*UrlBuilder) BuildStr

func (builder *UrlBuilder) BuildStr() string

func (*UrlBuilder) GetQuery

func (builder *UrlBuilder) GetQuery() url.Values

func (*UrlBuilder) GetURL

func (builder *UrlBuilder) GetURL() *url.URL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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