Home

Awesome

go-pushdeer-sdk

pushdeer 的golanga版本的sdk

GitHub forks GitHub Repo stars GitHub GitHub go.mod Go version

使用方式

在模块中安装

go get github.com/Luoxin/go-pushdeer-sdk

注册设备

package main

import (
	"github.com/Luoxin/go-pushdeer-sdk/psdk"
	log "github.com/sirupsen/logrus"
)

func main() {
	p, err := psdk.New("http://127.0.0.1:8800", "token")
	if err != nil {
		log.Errorf("err:%v", err)
		return
	}

	resp, err := p.DeviceList(&psdk.DeviceListReq{})
	if err != nil {
		log.Errorf("err:%v", err)
		return
	}

	for _, device := range resp.Content.Devices {
		log.Infof("%+v", device)
	}
}

TODO