🎭 Stream API Methods Playing Hide and Seek in Go SDK
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với các đoạn mã khởi tạo getstream.NewClient và LiveStreamController.StartStream trong issue, sau đó so sánh các phương thức và kiểu ID của chúng với API getstream-go hiện tại. Hoàn tất khi đường dẫn tạo livestream được báo cáo biên dịch với phiên bản Go SDK đã nêu hoặc cách sử dụng được hỗ trợ đã được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello i am trying to build a project to learn by building a backend clone of Tiktok i am trying to learn
What's Popping? 🎯
Trying to build a sick livestreaming feature but the Stream Go SDK methods are playing hard to get:
lc.streamClient.Callundefinedlc.streamClient.Video()undefined- Type mismatches with user IDs (string vs int)
Expected Behavior 🎪
Should be able to create livestreams like a boss using:
how i initialize the stream Video Livestream API
package config
import (
"os"
"github.com/GetStream/getstream-go"
)
func InitStreamVideo() (*getstream.Stream, error) {
apiKey := os.Getenv("STREAM_API_KEY")
apiSecret := os.Getenv("STREAM_API_SECRET")
client, err := getstream.NewClient(apiKey, apiSecret)
if err != nil {
return nil, err
}
return client, nil
}
The controller than handle these
package controllers
import (
"Tiktok/internal/database"
"Tiktok/internal/models"
"Tiktok/internal/utils"
"context"
"strconv"
"github.com/GetStream/getstream-go"
"github.com/go-playground/validator"
"github.com/gofiber/fiber/v2"
"github.com/google/uuid"
)
type LiveStreamController struct {
db database.Service
validate *validator.Validate
streamClient *getstream.Client
}
type StartStreamRequest struct {
Title string `json:"title" validate:"required"`
Description string `json:"description" validate:"required"`
}
func (lc *LiveStreamController) StartStream(c *fiber.Ctx) error {
ctx := context.Background()
claims := c.Locals("user").(*utils.Claims)
var req StartStreamRequest
if err := c.BodyParser(&req); err != nil {
return utils.SendErrorResponse(c, fiber.StatusBadRequest, "Invalid request", err.Error())
}
userID := strconv.Itoa(claims.UserID)
callID := uuid.New().String()
// Create livestream call
call := lc.streamClient.Video().Call("livestream", callID)
response, err := call.GetOrCreate(ctx, &getstream.GetOrCreateCallRequest{
Data: &getstream.CallRequest{
CreatedByID: getstream.PtrTo(userID),
Members: []getstream.MemberRequest{
{UserID: userID, Role: getstream.PtrTo("host")},
},
Custom: map[string]interface{}{
"title": req.Title,
"description": req.Description,
},
},
})
if err != nil {
return utils.SendErrorResponse(c, fiber.StatusInternalServerError, "Failed to create stream", err.Error())
}
// Save to database
stream := &models.LiveStream{
UserID: claims.UserID,
Title: req.Title,
Description: req.Description,
CallID: callID,
Status: "backstage",
StreamKey: response.StreamKey,
RtmpUrl: response.RtmpUrl,
}
if err := lc.db.CreateLiveStream(ctx, stream); err != nil {
return utils.SendErrorResponse(c, fiber.StatusInternalServerError, "Failed to save stream", err.Error())
}
return c.JSON(fiber.Map{
"status": "success",
"data": stream,
})
}
Current Behavior 🎪
Getting compiler errors faster than a Twitch chat during a fail moment
SDK Version
- GetStream Go SDK: latest
- Go version: latest
- Framework: Fiber
The Dream 🌟
Just trying to make the next big streaming platform here! Help a dev out!
- Ngôn ngữ chính
- Go
- Star
- 8
- Fork
- 3
- Merge trung bình
- 29 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GetStream/getstream-go
-
Daily integration run is redĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
GetStream/getstream-go#172 · 12 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Timestamp struct used in models.go seems incoherent with the used date formatCó thể đã có người làm @skb1129 đã nhận 112 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
GetStream/getstream-go#26 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GetStream/getstream-go
Issue tương tự
-
govulncheck reports 7 reachable vulnerabilities in dependenciesCó thể đã có người làm @dwisiswant0 đã nhận hôm nay. Đang mởType: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
projectdiscovery/rawhttp#558 ·
-
govulncheck reports 8 vulnerabilities in called codeCó thể đã có người làm @dwisiswant0 đã nhận hôm nay. Đang mởType: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
projectdiscovery/vulnx#517 ·
-
routing: the tray panel's stage stands still with motion reduced while a request is in flightĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
rubys/roundhouse#1946 ·