Skip to content

Commit

Permalink
solve amount
Browse files Browse the repository at this point in the history
  • Loading branch information
allan committed Jun 6, 2024
1 parent 080687f commit aeddb12
Showing 1 changed file with 25 additions and 30 deletions.
55 changes: 25 additions & 30 deletions compress/api_restreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package compress
import (
"encoding/json"
"fmt"

"gopkg.in/validator.v2"
)

Expand All @@ -11,7 +12,7 @@ import (
* @param {number} start_from
* @param {number} amount
* @returns restreamer list
*/
*/
func (o *compress) GetRestreamers() ([]Restreamer, error) {
requestBody := BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey}
/*&findRestreamersRequest{
Expand Down Expand Up @@ -67,14 +68,13 @@ func (o *compress) GetSingleRestreamer(instanceName string) (*Restreamer, error)
}

/*
*/
func (o *compress) ScaleRestreamer(instanceName string, scale int) (*ResponseServer, error){
//
*/
func (o *compress) ScaleRestreamer(instanceName string, scale int) (*ResponseServer, error) {
//
requestBody := &scaleRestreamerRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,
Scale: scale,
Scale: scale,
}
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
Expand All @@ -97,8 +97,7 @@ func (o *compress) ScaleRestreamer(instanceName string, scale int) (*ResponseSer
}

/*
*/
*/
func (o *compress) CreateEventsBulk(request []InstancesEventCreate) (*ResponseServer, error) {
requestBody := &bulkRestreamerRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
Expand All @@ -123,11 +122,11 @@ func (o *compress) CreateEventsBulk(request []InstancesEventCreate) (*ResponseSe
return &obj, nil
}

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

requestBody := &hlsBodyRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,
StreamProtocol: streamProtocol,
}
if errs := validator.Validate(requestBody); errs != nil {
Expand All @@ -149,12 +148,10 @@ func (o *compress) RestreamerHlsStart(instanceName string, streamProtocol string
return &obj, nil
}



func (o *compress) RestreamerHlsStop(instanceName string, streamProtocol string) (*HlsResponse, error){
func (o *compress) RestreamerHlsStop(instanceName string, streamProtocol string) (*HlsResponse, error) {
requestBody := &hlsBodyRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
InstanceName: instanceName,
StreamProtocol: streamProtocol,
}
if errs := validator.Validate(requestBody); errs != nil {
Expand All @@ -177,12 +174,11 @@ func (o *compress) RestreamerHlsStop(instanceName string, streamProtocol string
return &obj, nil
}


func (o *compress) RestreamerEventsHistory( startFrom int, amount int) ([]RestreamerEvent, error) {
func (o *compress) RestreamerEventsHistory(startFrom int, amount int) ([]RestreamerEvent, error) {
requestBody := &eventsHistoryRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
StartFrom: startFrom,
amount: amount,
Amount: amount,
}
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
Expand All @@ -203,15 +199,14 @@ func (o *compress) RestreamerEventsHistory( startFrom int, amount int) ([]Restre
return obj, nil
}


func (o *compress) GenerateVodProxy(eventId string, instanceName string, title string, ) (*generateVodResponse, error) {
func (o *compress) GenerateVodProxy(eventId string, instanceName string, title string) (*generateVodResponse, error) {
requestBody := &generateVodRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
ThumbnailsNumber:"0",
EventID: eventId,
CustomerID: &o.customerId,
Title: title,
Instance: instanceName,
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
ThumbnailsNumber: "0",
EventID: eventId,
CustomerID: &o.customerId,
Title: title,
Instance: instanceName,
}
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
Expand All @@ -230,4 +225,4 @@ func (o *compress) GenerateVodProxy(eventId string, instanceName string, title
return nil, err
}
return &obj, nil
}
}

0 comments on commit aeddb12

Please sign in to comment.