Documentation
¶
Index ¶
- func AESDecrypt(key []byte, s string) (string, error)
- func AESEncrypt(key []byte, s string) (string, error)
- func AESNewCBCDecrypter()
- func AESNewCBCEncrypter()
- 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 CloseDB()
- func FmtSprintfByte(b []byte) string
- 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
- 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 Redis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESNewCBCDecrypter ¶ added in v0.0.9
func AESNewCBCDecrypter()
func AESNewCBCEncrypter ¶ added in v0.0.9
func AESNewCBCEncrypter()
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 FmtSprintfByte ¶ added in v0.0.9
FmtSprintfByte []byte to string
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"
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 ConnAttempts_Postgres ¶ added in v0.0.8
func ConnAttempts_Postgres(attempts int) PostgresOption
ConnAttempts -.
func ConnTimeout_Postgres ¶ added in v0.0.8
func ConnTimeout_Postgres(timeout time.Duration) PostgresOption
ConnTimeout -.
func MaxPoolSize_Postgres ¶ added in v0.0.8
func MaxPoolSize_Postgres(size int) PostgresOption
MaxPoolSize -.
Directories
¶
| Path | Synopsis |
|---|---|
|
database
|
|
|
Package httpserver implements HTTP server.
|
Package httpserver implements HTTP server. |
Click to show internal directories.
Click to hide internal directories.