# MoreKit **Repository Path**: Leftyer/more-kit ## Basic Information - **Project Name**: MoreKit - **Description**: Less can be more. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-17 - **Last Updated**: 2025-12-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # more-kit Less can be more. ## Install ```bash go install gitee.com/Leftyer/more-kit@latest ``` ## Quick Start ```bash # version morekit -v 0.1.6 # reference import "gitee.com/Leftyer/more-kit/pkg/morekit" ``` ## Library Usage ```bash # /*--------------- Comp Area ---------------*/ # lossless WebP compression _ = morekit.CompImage("photo.png", "photo.webp", 3) # /*--------------- Device Area ---------------*/ # Platform info _ = morekit.DeviceGetInfo() # Device ID _ = morekit.DeviceGetId() # Device Name _ = morekit.DeviceGetName() # Boot Time _ = morekit.DeviceGetBootTime() # BIOS UUID _ = morekit.DeviceGetBIOSUUID() # CPU Name _ = morekit.DeviceGetCPUName() # CPU Cores _ = morekit.DeviceGetCPUCores() # Memory GB _ = morekit.DeviceGetMemoryGB() # Disk Total GB _ = morekit.DeviceGetDiskTotalGB() # IP List _ = morekit.DeviceGetIPList() # MAC List _ = morekit.DeviceGetMACList() # Default IP _ = morekit.DeviceGetDefaultIP() # /*--------------- Folder Area ---------------*/ # Folder exist 0:no clear 1:clear _ = morekit.FolderIsExist("/tmp", 0) # Folder copy _ = morekit.FolderCopy("./input", "./output") # Folder clear _ = morekit.FolderClear("./input") # /*--------------- File Area ---------------*/ # File exist _ = morekit.FileIsExist("note.txt") # File copy _ = morekit.FileCopy("src.txt", "dst.txt") # File read _, _ = morekit.FileRead("note.txt") # File write _ = morekit.FileWrite("note.txt", "hello") # /*--------------- Json Area ---------------*/ # Json write _ = morekit.JsonWrite("cfg.json", struct{ Host string }{"localhost"}) # Json read _, _ = morekit.JsonRead[struct{ Host string }]("cfg.json") # /*--------------- Utility Area ---------------*/ # Enc Md5 _ = morekit.EncMd5("kit") # AppData Path _ = morekit.AppDataPath("kit") # /*--------------- Date Area ---------------*/ # Date FormatDay _ = morekit.DateFormatDay("2025-11-18T14:23:45Z") # /*--------------- Database Area ---------------*/ # SQLite Plain cfg := kitdb.DBConfig{DBType: kitdb.DBTypeSQLite, DBName: "app", ConnStr: "./data", Password: ""} db, _ := morekit.DBCore(cfg) defer db.Close() # SQLite Encryption cfg := kitdb.DBConfig{DBType: kitdb.DBTypeSQLite, DBName: "app", ConnStr: "./data", Password: "123456"} db, _ := morekit.DBCore(cfg) defer db.Close() # PostgreSQL cfg := kitdb.DBConfig{DBType: kitdb.DBTypePostgreSQL, ConnStr: "host=localhost user=postgres password=123 dbname=test port=5432 sslmode=disable"} db, _ := morekit.DBCore(cfg) defer db.Close() # /*--------------- Network Area ---------------*/ # Network IsPortActivate(TCP) isOk := morekit.NetworkIsPortActivate(8080) # Network FreePort(TCP 2000–60000) p := morekit.NetworkGetFreePort() ``` ## License MIT – see [LICENSE](LICENSE) for details.