Skip to content

xiaojiaoyu100/tencent-lbs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tencent-lbs

腾讯位置服务

Author

zenghongru@gmail.com

Usage

package main

import (
	"context"
	"fmt"
	txlbs "github.com/xiaojiaoyu100/tencent-lbs"
)

func main() {
	// c需要缓存下来,不能频繁的创建client
	c, err := txlbs.New(
		txlbs.WithKey("your_key"),
		txlbs.WithSecretKey("your_secret_key"),
	)
	if err != nil {
		fmt.Println(err)
		return
	}

	resp, err := c.DistrictSearch(context.TODO(), "110000,111100")
	if err != nil {
		fmt.Println(err)
		return
	}
	if !resp.Success() {
		fmt.Println(resp.Message)
		return
	}
}