utils

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

获取指定目录下的所有视频文件

Index

Constants

This section is empty.

Variables

View Source
var (
	Db   *bolt.DB
	Mmap map[string]string
)
View Source
var Engine *xorm.Engine

Functions

func AddKeyValueByBucketName

func AddKeyValueByBucketName(db, table, key, value string) error

func AddKeyValueByBucketNameAuto

func AddKeyValueByBucketNameAuto(table, key, value string) error

func AddTables

func AddTables(db, tablename string) error

func Colorize

func Colorize(text string, status string, background string, underline bool, highshow bool) string

文字字体 参数介绍:text->文本内容 status->文字颜色 background->背景颜色 underline->是否下划线 highshow->是否高亮 http://www.cnblogs.com/frydsh/p/4139922.html

func CommandPty

func CommandPty(cmd string) error

func CreateBucket

func CreateBucket(db string) error

func DecodeBase64

func DecodeBase64(in string) (string, error)

解密base64

func DecodeBase64Bytes

func DecodeBase64Bytes(in string) ([]byte, error)

解密base64

func DeleteBucket

func DeleteBucket(db, tablename string) error

func DeleteKeyValueByBucket

func DeleteKeyValueByBucket(table, key string) error

func DeleteTables

func DeleteTables(db, tablename string) error

func EncodeBase64

func EncodeBase64(in string) string

加密base64

func ExecCommand

func ExecCommand(cmd string) ([]byte, error)

func ExecCommandString

func ExecCommandString(cmd string) (string, error)

func GetAllByTables

func GetAllByTables(name string) (map[string]string, error)

func GetAllFiles

func GetAllFiles(dirPth string, suff []string) (files []string, err error)

获取指定目录下的所有文件,包含子目录下的文件 strings.Replace(dirPth+PthSep+fi.Name(), ".", "/static", 1) 只能查找当前目录下的所有视频文件

func GetAllTables

func GetAllTables(db string) (map[string]string, error)

func GetCurrentDirectory

func GetCurrentDirectory() string

func GetIPs

func GetIPs() (ips []string)

func GetIps

func GetIps() []string

func GetMacAddrs

func GetMacAddrs() (macAddrs []string)

0:cf:e0:44:dd:be,enp1s0

func GetNowTime

func GetNowTime() string

func GetRandomSalt

func GetRandomSalt() string

return len=8 salt

func GetRandomString

func GetRandomString(len int) string

生成随机字符串

func GetValueByBucketName

func GetValueByBucketName(table, key string) ([]byte, error)

func Home

func Home() (string, error)

Home returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func In

func In(target string, source []string) bool

快速判断字符是否在字符数组中

func InitDB

func InitDB(dbName, defaultDb string)

func InitSqlite

func InitSqlite()

func IsPathExists

func IsPathExists(path string) bool

func Jiami

func Jiami(code string) string

加密

func MD5

func MD5(text string) string

生成32位MD5

func ParseIps

func ParseIps(in string) ([]string, error)

Types

type LogFileWriter

type LogFileWriter struct {
	File *os.File
	//write count
	Size int64
}

func (LogFileWriter) Write

func (p LogFileWriter) Write(data []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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