Skip to content

Go serverside SDK docs#746

Merged
tbarbugli merged 32 commits intomainfrom
go-sdk-docs
Oct 7, 2024
Merged

Go serverside SDK docs#746
tbarbugli merged 32 commits intomainfrom
go-sdk-docs

Conversation

@sachaarbonel
Copy link
Copy Markdown
Contributor

No description provided.

@sachaarbonel sachaarbonel marked this pull request as ready for review September 20, 2024 12:41
<TabItem value="go" label="Golang">

```go
client.UpdateUsers(ctx, &UpdateUsersRequest{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this properly spaced / formatted?

Users: map[string]UserRequest{
"user_id": {
Role: PtrTo("user"),
Custom: &map[string]interface{}{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointer to map is not necessary / weird (passing the map is ok)

Users: map[string]UserRequest{
"user_id": {
Role: PtrTo("user"),
Custom: &map[string]interface{}{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptr to map

Users: []UpdateUserPartialRequest{
{
ID: "user_id",
Set: &map[string]interface{}{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptr to map

userID := "john"

// exp and iat are optional, token will be valid for 1 hour
exp := time.Now().Add(1 * time.Hour)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not consistent with Python (we pass 3600, not time.now + 1h)

Ring: PtrTo(true),
Data: &CallRequest{
CreatedByID: PtrTo("myself"),
Members: &[]MemberRequest{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptr to slice

Grants: &map[string][]string{
"user": []string{},
"call_member": []string{
READ_CALL.String(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why dont we use constant strings?

@tbarbugli tbarbugli merged commit 57563dd into main Oct 7, 2024
@tbarbugli tbarbugli deleted the go-sdk-docs branch October 7, 2024 13:07
@github-actions github-actions bot mentioned this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants