Small library for access control system NVP Bolid "Orion Pro"
All features available from Datastore
interface
AddWorker(string) error
DeleteWorker(string) error
DisableWorkerCard(string) error
EnableWorkerCard(string) error
Company() ([]*Company, error)
Doors() ([]*Door, error)
Workers(string) ([]*Worker, error)
Events(string, string, string, uint, bool) ([]*Event, error)
EventsValues() ([]*Event, error)
EventsTail(time.Duration, string) error
WorkedTime(string, string, string, string) ([]*Event, error)
Set environment variable BOLID_DSN
export BOLID_DSN="server=127.0.0.1;user id=username;password=passwd;database=base"
- companies list
package main
import (
"fmt"
"os"
"github.com/jezman/libgorion"
_ "github.com/denisenkom/go-mssqldb"
)
func main() {
dsn := os.Getenv("BOLID_DSN")
db, err := libgorion.OpenDB(dsn)
if err != nil {
panic(err)
}
defer db.Close()
companies, err := db.Company()
if err != nil {
fmt.Println(err)
}
for num, company := range companies {
fmt.Println(num, company.Name, company.WorkersCount)
}
}
- gorion based on this library
MIT © 2018 jezman