🎭 Stream API Methods Playing Hide and Seek in Go SDK
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza con los fragmentos de inicialización de getstream.NewClient y de LiveStreamController.StartStream incluidos en el issue, y luego compara sus métodos y tipos de ID con la API actual de getstream-go. Se considera terminado cuando la ruta de creación del livestream indicada compila con la versión del Go SDK especificada, o cuando se documenta el uso compatible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Go
- Estrellas
- 8
- Forks
- 3
- Merge medio
- 29 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de GetStream/getstream-go
-
Daily integration run is redAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
GetStream/getstream-go#172 · 11 comentarios ·
Los mantenedores suelen responder en 1 día
-
Timestamp struct used in models.go seems incoherent with the used date formatPosiblemente ocupada @skb1129 la tomó hace 111 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
GetStream/getstream-go#26 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de GetStream/getstream-go
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
JakeChampion/lang#14392 ·
Los mantenedores suelen responder en 1 día
-
agent-butler-finding bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
jordansmall/spindrift#6557 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Custom tool truncation leaves unused stream copies openPosiblemente ocupada @OUAO-FRANK la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyAbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
crmne/hyprmoncfg#114 · 1 comentario ·
Los mantenedores suelen responder en 1 día