Skip to content

Commit

Permalink
solve RestreamerHlsStop
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Jun 6, 2024
1 parent 25e0208 commit 8132b67
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
46 changes: 45 additions & 1 deletion compress/api_restreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,57 @@ func (o *compress) CreateEventsBulk(request []InstancesEventCreate) (*ResponseSe
return &obj, nil
}

func (o *compress) RestreamerHlsStart(request hlsBodyRequest) (*HlsResponse, error){
func (o *compress) RestreamerHlsStart(instanceName string, streamProtocol string) (*HlsResponse, error){

requestBody := &hlsBodyRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,
StreamProtocol: streamProtocol,
}
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
return nil, errs
}
resp, err := o.restyPost(RESTREAMER_HLS_START(), requestBody)
if err != nil {
return nil, err
}
o.debugPrint(resp)
if resp.IsError() {
return nil, fmt.Errorf("")
}
var obj HlsResponse
if err := json.Unmarshal(resp.Body(), &obj); err != nil {
return nil, err
}
return nil, nil
}



func (o *compress) RestreamerHlsStop(request hlsBodyRequest) (*HlsResponse, error){
requestBody := &hlsBodyRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,

Check failure on line 157 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: instanceName

Check failure on line 157 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: instanceName

Check failure on line 157 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: instanceName

Check failure on line 157 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: instanceName
StreamProtocol: streamProtocol,

Check failure on line 158 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: streamProtocol

Check failure on line 158 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: streamProtocol

Check failure on line 158 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: streamProtocol

Check failure on line 158 in compress/api_restreamer.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: streamProtocol
}
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
return nil, errs
}
resp, err := o.restyPost(RESTREAMER_HLS_STOP(), requestBody)
if err != nil {
return nil, err
}

o.debugPrint(resp)
if resp.IsError() {
return nil, fmt.Errorf("")
}
var obj HlsResponse
if err := json.Unmarshal(resp.Body(), &obj); err != nil {
return nil, err
}
return nil, nil
}

Expand Down
4 changes: 0 additions & 4 deletions compress/api_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,3 @@ func (o *compress) UploadMultipart(reader io.Reader, size int64, categoryId int,

return responseCreateUploadAndEncode, nil
}

func (o *compress) GetCustomerS3Zone() (*CustomerS3, error){
return nil, nil
}
5 changes: 3 additions & 2 deletions compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ type ICompress interface {
GetSingleRestreamer(instanceName string) (*Restreamer, error)
ScaleRestreamer(instanceName string, scale int) (*ResponseServer, error)
CreateEventsBulk(request []InstancesEventCreate) (*ResponseServer, error)
RestreamerHlsStart(request hlsBodyRequest) (*HlsResponse, error)
RestreamerHlsStop(request hlsBodyRequest) (*HlsResponse, error)
RestreamerHlsStart(instanceName string, streamProtocol string) (*HlsResponse, error)
RestreamerHlsStop(requinstanceName string, streamProtocol string) (*HlsResponse, error)
RestreamerEventsHistory( startFrom int, amount int) ([]RestreamerEvent, error)
GetCustomerS3Zone() (*CustomerS3, error)
GenerateVodProxy(request generateVodRequest) (*generateVodResponse, error)
//
Expand Down

0 comments on commit 8132b67

Please sign in to comment.