Bugyo Cloud Punchmark Client for go
- Install with PowerShell
iwr https://github.com/tomtwinkle/bugyo-client-go/releases/download/v0.10.6/bugyoclient_windows_amd64.zip -OutFile bugyoclient.zip && Expand-Archive -Path bugyoclient.zip && rm bugyoclient.zip
cd bugyoclient
.\bugyoclient.exe help
- 出勤
.\bugyoclient.exe punchmark --type in
or
.\bugyoclient.exe pm -t in
- 退出
.\bugyoclient.exe punchmark --type out
or
.\bugyoclient.exe pm -t out
- 外出
.\bugyoclient.exe punchmark --type go
or
.\bugyoclient.exe pm -t go
- 再入
.\bugyoclient.exe punchmark --type return
or
.\bugyoclient.exe pm -t return
go get github.com/tomtwinkle/bugyo-client-go
package main
import (
"github.com/tomtwinkle/bugyo-client-go"
"log"
)
func main() {
config := &bugyoclient.BugyoConfig{
TenantCode: "<Your Tenant Code>",
OBCiD: "<Your OBCID>",
Password: "<Your Password>",
}
client, err := bugyoclient.NewClient(config)
if err != nil {
log.Fatal(err)
}
if err := client.Login(); err != nil {
log.Fatal(err)
}
if err := client.Punchmark(bugyoclient.ClockTypeClockIn); err != nil {
log.Fatal(err)
}
}
- download go modules
go mod download
- tag release
git fetch
git switch main
git pull origin main
git tag -a vX.X.X -m "release comment"
git push origin vX.X.X
- create
.env
file
TENANTCODE=<You Tenant code>
OBCID=<You OBCID>
PASSWORD=<You Password>
- go test login
go test login_test.go