Skip to content

Commit

Permalink
[VID-105]: Update go docs (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbugli authored Nov 5, 2024
2 parents 1db4ae2 + 76b4bff commit ed5ea84
Show file tree
Hide file tree
Showing 22 changed files with 268 additions and 268 deletions.
4 changes: 2 additions & 2 deletions docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ call.stop_hls_broadcasting()
<TabItem value="go" label="Golang">

```go
call.StartHLSBroadcasting(ctx)
call.StartHLSBroadcasting(ctx, &getstream.StartHLSBroadcastingRequest{})
// to end broadcasting
call.StopHLSBroadcasting(ctx)
call.StopHLSBroadcasting(ctx, &getstream.StopHLSBroadcastingRequest{})
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ client.video.update_call_type(
<TabItem value="go" label="Golang">

```go
response, err := client.Video().UpdateCallType(ctx, callTypeName, &UpdateCallTypeRequest{
Settings: &CallSettingsRequest{
Broadcasting: &BroadcastSettingsRequest{
Enabled: PtrTo(true),
Rtmp: &RTMPSettingsRequest{
Enabled: PtrTo(true),
Quality: PtrTo("1080p"),
Layout: &LayoutSettingsRequest{
response, err := client.Video().UpdateCallType(ctx, callTypeName, &getstream.UpdateCallTypeRequest{
Settings: &getstream.CallSettingsRequest{
Broadcasting: &getstream.BroadcastSettingsRequest{
Enabled: getstream.PtrTo(true),
Rtmp: &getstream.RTMPSettingsRequest{
Enabled: getstream.PtrTo(true),
Quality: getstream.PtrTo("1080p"),
Layout: &getstream.LayoutSettingsRequest{
Name: "spotlight",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ call.send_call_event(user_id=user.id, custom={"render-animation": "balloons"})

```go
// send a custom event to all users watching the call
call.SendCallEvent(ctx, &SendCallEventRequest{
call.SendCallEvent(ctx, &getstream.SendCallEventRequest{
Custom: &map[string]interface{}{
"render-animation": "balloons",
},
Expand Down
6 changes: 3 additions & 3 deletions docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ call.go_live(start_hls=True, start_recording=True)
<TabItem value="go" label="Golang">

```go
call.GoLive(ctx, &GoLiveRequest{
StartHls: PtrTo(true),
StartRecording: PtrTo(true),
call.GoLive(ctx, &getstream.GoLiveRequest{
StartHls: getstream.PtrTo(true),
StartRecording: getstream.PtrTo(true),
})
```
</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ call.start_rtmp_broadcasts(
<TabItem value="go" label="Golang">

```go
call.StartRTMPBroadcasts(ctx, &StartRTMPBroadcastsRequest{
Broadcasts: []RTMPBroadcastRequest{
call.StartRTMPBroadcasts(ctx, &getstream.StartRTMPBroadcastsRequest{
Broadcasts: []getstream.RTMPBroadcastRequest{
{
Name: "youtube_channel",
StreamUrl: "rtmps://x.rtmps.youtube.com/live2",
StreamKey: PtrTo("your_stream_key"),
StreamKey: getstream.PtrTo("your_stream_key"),
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ call.stop_all_rtmp_broadcasts()
<TabItem value="go" label="Golang">

```go
call.StopAllRTMPBroadcasts(ctx)
call.StopAllRTMPBroadcasts(ctx, &getstream.StopAllRTMPBroadcastsRequest{})
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ call.stop_rtmp_broadcast(name='youtube_channel')
<TabItem value="go" label="Golang">

```go
call.StopRTMPBroadcast(ctx, "youtube_channel", &StopRTMPBroadcastsRequest{})
call.StopRTMPBroadcast(ctx, "youtube_channel", &getstream.StopRTMPBroadcastsRequest{})
```

</TabItem>
Expand Down
6 changes: 3 additions & 3 deletions docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ print(rtmp_url, stream_key)
```go
call := client.Video().Call("default", uuid.New().String())
// create the call where the RTMP will be sent to
response, err := call.GetOrCreate(ctx, nil)
response, err := call.GetOrCreate(ctx, &getstream.GetOrCreateCallRequest{})

// ensure we have a user for the host to send video via RTMP
client.UpdateUsers(ctx, &UpdateUsersRequest{
Users: map[string]UserRequest{
client.UpdateUsers(ctx, &getstream.UpdateUsersRequest{
Users: map[string]getstream.UserRequest{
"tommaso-the-host": {
ID: "tommaso-the-host",
},
Expand Down
40 changes: 20 additions & 20 deletions docusaurus/video/docusaurus/docs/api/_common_/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,26 @@ client.video.update_call_type(name='allhands', external_storage='my-s3')
```go
// 1. create a new storage with all the required parameters

client.CreateExternalStorage(ctx, &CreateExternalStorageRequest{
client.CreateExternalStorage(ctx, &getstream.CreateExternalStorageRequest{
Name: "my-s3",
StorageType: "s3",
Bucket: "my-bucket",
Path: PtrTo("directory_name/"),
AwsS3: &S3Request{
Path: getstream.PtrTo("directory_name/"),
AwsS3: &getstream.S3Request{
S3Region: "us-east-1",
S3ApiKey: PtrTo("my-access"),
S3Secret: PtrTo("my-secret"),
S3ApiKey: getstream.PtrTo("my-access"),
S3Secret: getstream.PtrTo("my-secret"),
},
})


// 2. (Optional) Check storage configuration for correctness
// In case of any errors, this will throw a StreamAPIException.
response, err := client.CheckExternalStorage(ctx, "my-s3")
response, err := client.CheckExternalStorage(ctx, "my-s3", &getstream.CheckExternalStorageRequest{})

// 3. update the call type to use the new storage
client.Video().UpdateCallType(ctx, "allhands", &UpdateCallTypeRequest{
ExternalStorage: PtrTo("my-s3"),
client.Video().UpdateCallType(ctx, "allhands", &getstream.UpdateCallTypeRequest{
ExternalStorage: getstream.PtrTo("my-s3"),
})
```

Expand Down Expand Up @@ -224,17 +224,17 @@ call.start_recording(recording_external_storage="my-storage")

```go
// update the call type to use Stream S3 storage for recordings
client.Video().UpdateCallType(ctx, "my-call-type", &UpdateCallTypeRequest{
ExternalStorage: PtrTo("stream-s3"),
client.Video().UpdateCallType(ctx, "my-call-type", &getstream.UpdateCallTypeRequest{
ExternalStorage: getstream.PtrTo("stream-s3"),
})

// specify my-storage storage when starting call transcribing
call.StartTranscription(ctx, &StartTranscriptionRequest{
TranscriptionExternalStorage: PtrTo("my-storage"),
call.StartTranscription(ctx, &getstream.StartTranscriptionRequest{
TranscriptionExternalStorage: getstream.PtrTo("my-storage"),
})

// specify my-storage storage for recording
call.StartRecording(ctx, &StartRecordingRequest{
call.StartRecording(ctx, &getstream.StartRecordingRequest{
RecordingExternalStorage: PtrTo("my-storage"),
})
```
Expand Down Expand Up @@ -378,12 +378,12 @@ if err != nil {
log.Fatal(err)
}

client.CreateExternalStorage(ctx, &CreateExternalStorageRequest{
client.CreateExternalStorage(ctx, &getstream.CreateExternalStorageRequest{
Name: "my-gcs",
StorageType: "gcs",
Bucket: "my-bucket",
Path: PtrTo("directory_name/"),
GcsCredentials: PtrTo(string(creds)),
Path: getstream.PtrTo("directory_name/"),
GcsCredentials: getstream.PtrTo(string(creds)),
})
```

Expand Down Expand Up @@ -488,12 +488,12 @@ client.create_external_storage(
<TabItem value="go" label="Golang">

```go
client.CreateExternalStorage(ctx, &CreateExternalStorageRequest{
client.CreateExternalStorage(ctx, &getstream.CreateExternalStorageRequest{
Name: "my-abs",
StorageType: "abs",
Bucket: "my-bucket",
Path: PtrTo("directory_name/"),
AzureBlob: &AzureRequest{
Path: getstream.PtrTo("directory_name/"),
AzureBlob: &getstream.AzureRequest{
AbsAccountName: "...",
AbsClientID: "...",
AbsClientSecret: "...",
Expand Down
Loading

0 comments on commit ed5ea84

Please sign in to comment.