尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Official Go SDK for the Linkbreakers API: create dynamic QR codes and short links, and read scan analytics.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Official Go SDK for the Linkbreakers API, auto-generated from OpenAPI specification.
go get github.com/linkbreakers-com/linkbreakers-go
package main
import (
"context"
"fmt"
"log"
linkbreakers "github.com/linkbreakers-com/linkbreakers-go"
)
func main() {
client := linkbreakers.NewAPIClient(linkbreakers.NewConfiguration())
// Every request reads the Bearer token from its context
ctx := context.WithValue(context.Background(), linkbreakers.ContextAccessToken, "your-api-token")
// Create a shortened link
request := linkbreakers.NewCreateLinkRequest("https://example.com")
request.SetName("My Link")
created, _, err := client.LinksAPI.LinksServiceCreate(ctx).CreateLinkRequest(*request).Execute()
if err != nil {
log.Fatalf("Error creating link: %v", err)
}
link := created.GetLink()
fmt.Println("Short link:", link.GetShortlink())
// List links
links, _, err := client.LinksAPI.LinksServiceList(ctx).PageSize(10).Execute()
if err != nil {
log.Fatalf("Error listing links: %v", err)
}
fmt.Printf("Found %d links\n", len(links.GetLinks()))
}
Each API is a field on the client (client.LinksAPI, client.VisitorsAPI, ...) and each operation is named after the API's operation ID (LinksServiceCreate, LinksServiceList, VisitorsServiceIdentify, ...). Path parameters are arguments; query parameters and the request body are builder methods, and Execute() sends the request.
The SDK uses Bearer token authentication. Put your workspace API token in the context passed to each call with linkbreakers.ContextAccessToken, as in the example above. Get a token from the Linkbreakers dashboard.
For detailed API documentation, visit: https://docs.linkbreakers.com
This SDK is automatically generated from the Linkbreakers OpenAPI specification and published when the API is updated. This README is written by hand: scripts/check-docs.sh compiles every Go block in it against the generated code, on pull requests and before every release.
Current API version: See OPENAPI_VERSION
Report issues at: https://github.com/linkbreakers-com/linkbreakers-go/issues
MIT License