-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2: rename package from tailscale -> tsclient
Some consumers of this SDK, for example terraform-provider-tailscale, use other packages named 'tailscale'. To avoid having to alias when importing this package, rename to 'tsclient' to avoid most collisions by default. Updates tailscale/corp#21867 Signed-off-by: Percy Wegmann <[email protected]>
- Loading branch information
Showing
10 changed files
with
63 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tailscale | ||
package tsclient | ||
|
||
import ( | ||
_ "embed" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tailscale | ||
package tsclient | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tailscale_test | ||
package tsclient_test | ||
|
||
import ( | ||
"context" | ||
|
@@ -7,7 +7,7 @@ import ( | |
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/tailscale/tailscale-client-go/v2" | ||
tsclient "github.com/tailscale/tailscale-client-go/v2" | ||
) | ||
|
||
func TestClient_Contacts(t *testing.T) { | ||
|
@@ -16,17 +16,17 @@ func TestClient_Contacts(t *testing.T) { | |
client, server := NewTestHarness(t) | ||
server.ResponseCode = http.StatusOK | ||
|
||
expectedContacts := &tailscale.Contacts{ | ||
Account: tailscale.Contact{ | ||
expectedContacts := &tsclient.Contacts{ | ||
Account: tsclient.Contact{ | ||
Email: "[email protected]", | ||
FallbackEmail: "[email protected]", | ||
NeedsVerification: false, | ||
}, | ||
Support: tailscale.Contact{ | ||
Support: tsclient.Contact{ | ||
Email: "[email protected]", | ||
NeedsVerification: false, | ||
}, | ||
Security: tailscale.Contact{ | ||
Security: tsclient.Contact{ | ||
Email: "[email protected]", | ||
FallbackEmail: "[email protected]", | ||
NeedsVerification: true, | ||
|
@@ -49,14 +49,14 @@ func TestClient_UpdateContact(t *testing.T) { | |
server.ResponseBody = nil | ||
|
||
email := "[email protected]" | ||
updateRequest := tailscale.UpdateContactRequest{ | ||
updateRequest := tsclient.UpdateContactRequest{ | ||
Email: &email, | ||
} | ||
err := client.Contacts().Update(context.Background(), tailscale.ContactAccount, updateRequest) | ||
err := client.Contacts().Update(context.Background(), tsclient.ContactAccount, updateRequest) | ||
assert.NoError(t, err) | ||
assert.Equal(t, http.MethodPatch, server.Method) | ||
assert.Equal(t, "/api/v2/tailnet/example.com/contacts/account", server.Path) | ||
var receivedRequest tailscale.UpdateContactRequest | ||
var receivedRequest tsclient.UpdateContactRequest | ||
err = json.Unmarshal(server.Body.Bytes(), &receivedRequest) | ||
assert.NoError(t, err) | ||
assert.EqualValues(t, updateRequest, receivedRequest) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tailscale | ||
package tsclient | ||
|
||
import ( | ||
"context" | ||
|
Oops, something went wrong.