Skip to content

Commit 299d9b1

Browse files
committed
move v2 module to root of repo
Updates tailscale/corp#22748 Signed-off-by: Percy Wegmann <[email protected]>
1 parent 6f5a0e9 commit 299d9b1

31 files changed

+55
-60
lines changed

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# tailscale.com/client/tailscale/v2
2+
3+
[![Go Reference](https://pkg.go.dev/badge/tailscale.com/client/tailscale/v2.svg)](https://pkg.go.dev/tailscale.com/client/tailscale/v2)
4+
[![Github Actions](https://github.com/tailscale/tailscale-client-go-v2/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/tailscale/tailscale-client-go-v2/actions/workflows/ci.yml)
5+
6+
The official client implementation for the [Tailscale](https://tailscale.com) HTTP API.
7+
For more details, please see [API documentation](https://tailscale.com/api).
8+
9+
## Example (Using API Key)
10+
11+
```go
12+
package main
13+
14+
import (
15+
"context"
16+
"os"
17+
18+
"tailscale.com/client/tailscale/v2"
19+
)
20+
21+
func main() {
22+
client := &tailscale.Client{
23+
Tailnet: os.Getenv("TAILSCALE_TAILNET"),
24+
APIKey: os.Getenv("TAILSCALE_API_KEY"),
25+
}
26+
27+
devices, err := client.Devices().List(context.Background())
28+
}
29+
```
30+
31+
## Example (Using OAuth)
32+
33+
```go
34+
package main
35+
36+
import (
37+
"context"
38+
"os"
39+
40+
"tailscale.com/client/tailscale/v2"
41+
)
42+
43+
func main() {
44+
client := &tailscale.Client{
45+
Tailnet: os.Getenv("TAILSCALE_TAILNET"),
46+
HTTP: tailscale.OAuthConfig{
47+
ClientID: os.Getenv("TAILSCALE_OAUTH_CLIENT_ID"),
48+
ClientSecret: os.Getenv("TAILSCALE_OAUTH_CLIENT_SECRET"),
49+
Scopes: []string{"all:write"},
50+
}.HTTPClient(),
51+
}
52+
53+
devices, err := client.Devices().List(context.Background())
54+
}
55+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)