Documentation ¶
Overview ¶
Package zkteco parses the XLS files outputted from zkteco device(KQ803) and update the employee attendance data in Redis.
Example ¶
package main import ( "log" "path" "github.com/northbright/pathhelper" "github.com/northbright/zkteco" ) func main() { // Set debug mode to true. zkteco.SetDebugMode(true) // Open a DB by given Redis address and password. db := zkteco.Open(":6379", "") // Get absolute path of example attendance xls file. f, _ := pathhelper.GetCurrentExecDir() f = path.Join(f, "files/campus-a.xls") // Update attendance. err := db.UpdateAttendance(f) if err != nil { log.Printf("db.UpdateAttendance() failed: %v", err) return } log.Printf("db.UpdateAttendance ok") }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRedisConn ¶
GetRedisConn gets the Redis connection.
Types ¶
type DB ¶
type DB struct { // RedisAddr is Redis address. e.g. ":6379". RedisAddr string // RedisPassword is Redis password. RedisPassword string }
DB represents zkteco attendance database.
func (*DB) UpdateAttendance ¶
UpdateAttendance updates employees' attendance data by XLS file which is outputted by zkteco device.
Click to show internal directories.
Click to hide internal directories.