Live video on the AT Protocol
79
fork

Configure Feed

Select the types of activity you want to include in your feed.

at eli/components 38 lines 1.0 kB view raw
1package spxrpc 2 3import ( 4 "context" 5 "io" 6 "net/http" 7 8 comatprototypes "github.com/bluesky-social/indigo/api/atproto" 9 "github.com/bluesky-social/indigo/xrpc" 10 "github.com/labstack/echo/v4" 11 "github.com/streamplace/oatproxy/pkg/oatproxy" 12 "go.opentelemetry.io/otel" 13 "stream.place/streamplace/pkg/log" 14) 15 16func (s *Server) handleComAtprotoRepoUploadBlob(ctx context.Context, r io.Reader, contentType string) (*comatprototypes.RepoUploadBlob_Output, error) { 17 ctx, span := otel.Tracer("server").Start(ctx, "handleComAtprotoRepoUploadBlob") 18 defer span.End() 19 20 session, client := oatproxy.GetOAuthSession(ctx) 21 if session == nil { 22 return nil, echo.NewHTTPError(http.StatusUnauthorized, "oauth session not found") 23 } 24 25 var out comatprototypes.RepoUploadBlob_Output 26 27 var xrpcType xrpc.XRPCRequestType 28 var err error 29 xrpcType = xrpc.Procedure 30 err = client.Do(ctx, xrpcType, contentType, "com.atproto.repo.uploadBlob", nil, r, &out) 31 32 if err != nil { 33 log.Error(ctx, "upstream xrpc error", "error", err) 34 return nil, err 35 } 36 37 return &out, nil 38}