Documentation
¶
Index ¶
- func AESDecrypt(key []byte, s string) (string, error)
- func AESEncrypt(key []byte, s string) (string, error)
- func AESNewCBCDecrypter(keyString, cipherString string) (string, error)
- func AESNewCBCEncrypter(keyString, plainString string) (string, error)
- func AESNewCFBDecrypter()
- func AESNewCFBEncrypter()
- func AESNewGCMDecrypt(keyString, nonceString, ciphertext string) (string, error)
- func AESNewGCMEncrypt(keyString, plaintext string) (string, error)
- func BCryptCompareHashAndPassword(pwd, hash string) bool
- func BCryptGenerateFromPassword(pwd string) (string, error)
- func ByteString(b []byte) string
- func BytesNewBufferString(b []byte) string
- func CloseRedisClient() error
- func FmtSprintfByte(b []byte) string
- func GetRedisClient() *redis.Client
- func NewRedisClient(addr string, opts ...RedisOption) *redis.Client
- func SliceRemoveIndex(slice []int, s int) []int
- func SliceRemoveIndexUnOrder(s []int, i int) []int
- func StrconvFormatInt(i int64) string
- func StrconvParseFloat(i int) (float64, error)
- func StrconvParseInt(s string) (int64, error)
- func StringByte(s string) []byte
- func TimeFormat(tm time.Time) string
- func TimeNowFormat() string
- func TimeParse(s string) (time.Time, error)
- func TimeUnix(sec int64) time.Time
- func UUIDNewString() string
- type MariaDB
- type MariaDBOption
- func ConnAttempts_MYSQL(attempts int) MariaDBOption
- func ConnMaxIdleTime_MYSQL(d time.Duration) MariaDBOption
- func ConnMaxLifetime_MYSQL(d time.Duration) MariaDBOption
- func ConnTimeout_MYSQL(timeout time.Duration) MariaDBOption
- func MaxIdleConns_MYSQL(size int) MariaDBOption
- func MaxOpenConns_MYSQL(size int) MariaDBOption
- type Postgres
- type PostgresOption
- type RedisOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESNewCBCDecrypter ¶ added in v0.0.9
func AESNewCBCEncrypter ¶ added in v0.0.9
func AESNewCFBDecrypter ¶ added in v0.0.9
func AESNewCFBDecrypter()
func AESNewCFBEncrypter ¶ added in v0.0.9
func AESNewCFBEncrypter()
func AESNewGCMDecrypt ¶ added in v0.0.9
func AESNewGCMEncrypt ¶ added in v0.0.9
func BCryptCompareHashAndPassword ¶ added in v0.0.9
BCryptCompareHashAndPassword true or false
func BCryptGenerateFromPassword ¶ added in v0.0.9
BCryptGenerateFromPassword generate hash from password
func BytesNewBufferString ¶ added in v0.0.9
BytesNewBufferString []byte to string
func CloseRedisClient ¶ added in v0.0.10
func CloseRedisClient() error
func FmtSprintfByte ¶ added in v0.0.9
FmtSprintfByte []byte to string
func GetRedisClient ¶ added in v0.0.10
func NewRedisClient ¶ added in v0.0.8
func NewRedisClient(addr string, opts ...RedisOption) *redis.Client
func SliceRemoveIndex ¶ added in v0.0.10
SliceRemoveIndex 移除 slice 中的一个元素
func SliceRemoveIndexUnOrder ¶ added in v0.0.10
SliceRemoveIndexUnOrder 移除 slice 中的一个元素(无序,但效率高)
func StrconvFormatInt ¶
StrconvFormatInt 1645270804 to "1645270804"
func StrconvParseFloat ¶ added in v0.0.8
StrconvParseFloat int/100 to float64 保留 2 位小数点 example: 2333 -> 23.33
func StrconvParseInt ¶
StrconvParseInt "1645270804" to 1645270804
func TimeFormat ¶
TimeFormat time.Time to "2006-01-02 15:04:05"
func UUIDNewString ¶ added in v0.0.10
func UUIDNewString() string
UUIDNewString creates a new random UUID
Types ¶
type MariaDB ¶ added in v0.0.8
func GetMariaDB ¶ added in v0.0.8
func GetMariaDB() *MariaDB
func NewMariaDB ¶ added in v0.0.8
func NewMariaDB(url string, opts ...MariaDBOption) *MariaDB
type MariaDBOption ¶ added in v0.0.8
type MariaDBOption func(*MariaDB)
func ConnAttempts_MYSQL ¶ added in v0.0.8
func ConnAttempts_MYSQL(attempts int) MariaDBOption
ConnAttempts_MYSQL 尝试连接数据库次数
func ConnMaxIdleTime_MYSQL ¶ added in v0.0.8
func ConnMaxIdleTime_MYSQL(d time.Duration) MariaDBOption
ConnMaxIdleTime_MYSQL 一个连接空闲的最大时长
func ConnMaxLifetime_MYSQL ¶ added in v0.0.8
func ConnMaxLifetime_MYSQL(d time.Duration) MariaDBOption
ConnMaxLifetime_MYSQL 一个连接使用的最大时长
func ConnTimeout_MYSQL ¶ added in v0.0.8
func ConnTimeout_MYSQL(timeout time.Duration) MariaDBOption
ConnTimeout_MYSQL 连接数据库超时时间
func MaxIdleConns_MYSQL ¶ added in v0.0.8
func MaxIdleConns_MYSQL(size int) MariaDBOption
MaxIdleConns_MYSQL 最大闲置的连接数
func MaxOpenConns_MYSQL ¶ added in v0.0.8
func MaxOpenConns_MYSQL(size int) MariaDBOption
MaxOpenConns_MYSQL 最大打开的连接数
type Postgres ¶ added in v0.0.8
type Postgres struct {
Builder squirrel.StatementBuilderType
Pool *pgxpool.Pool
// contains filtered or unexported fields
}
Postgres -.
func GetPostgresDB ¶ added in v0.0.8
func GetPostgresDB() *Postgres
func NewPostgresDB ¶ added in v0.0.8
func NewPostgresDB(url string, opts ...PostgresOption) (*Postgres, error)
NewPostgresDB -.
type PostgresOption ¶ added in v0.0.8
type PostgresOption func(*Postgres)
Option -.
func ConnTimeout ¶ added in v0.0.10
func ConnTimeout(timeout time.Duration) PostgresOption
ConnTimeout -.
type RedisOption ¶ added in v0.0.10
func RedisDB ¶ added in v0.0.10
func RedisDB(db int) RedisOption
func RedisPassword ¶ added in v0.0.10
func RedisPassword(pwd string) RedisOption
func RedisPoolSize ¶ added in v0.0.10
func RedisPoolSize(poolSize int) RedisOption
Directories
¶
| Path | Synopsis |
|---|---|
|
database
|
|
|
Package httpserver implements HTTP server.
|
Package httpserver implements HTTP server. |