Skip to content

Commit

Permalink
need to fix hls start and hls stop
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Jun 3, 2024
1 parent 2db5fd4 commit 0831c67
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
10 changes: 10 additions & 0 deletions compress/api_restreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,14 @@ func (o *compress) CreateEventsBulk(request []InstancesEventCreate) (*ResponseSe
}
o.debugPrint(obj)
return &obj, nil
}

func (o *compress) RestreamerHlsStart(request hlsBodyRequest) (*HlsResponse, error){
return nil, nil
}



func (o *compress) RestreamerHlsStop(request hlsBodyRequest) (*HlsResponse, error){
return nil, nil
}
3 changes: 3 additions & 0 deletions compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ 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)
//
}

Expand Down Expand Up @@ -64,6 +66,7 @@ func NewCompress(customerName, apiKey string, isDebug bool) (ICompress, error) {
if err != nil {
return nil, err
}
// @p4xx07 need to refactor with multizone
c.minioClient, err = getMinioClient(
u.Host,
cred.S3AccessKey,
Expand Down
52 changes: 51 additions & 1 deletion compress/model_restreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,54 @@ type InstancesEventCreate struct {
type bulkRestreamerRequest struct {
BaseModel
Instances []InstancesEventCreate
}
}


type HlsResponse struct {
Message string `json:"message" `
Result string `json:"result" `
}

type hlsBodyRequest struct {
BaseModel
InstanceName string `json:"instance_name" `
StreamProtocol string `json:"stream_protocol" `
}


type startPushRequest struct {
BaseModel
InstanceName string `json:"instance_name" validate:"min=0" required:"true"`
ExternalServers []struct {
ExternalServer string `json:"external_server" `
IngestProtocol string `json:"ingest_protocol" `
AudioChannel string `json:"audio_channel" `
} `json:"external_servers"`
}


type stopPushRequest struct {
BaseModel
InstanceName string `json:"instance_name" `
ExternalServers []struct {
ProcessID string `json:"process_id" `
} `json:"external_servers"`
}


type startPullRequest struct {
BaseModel
InstanceName string `json:"instance_name" `
ExternalServer string `json:"external_server" `
IngestProtocol string `json:"ingest_protocol" `
AudioChannel string `json:"audio_channel" `
Type string `json:"type" `
Encoding string `json:"encoding" `
}


type stopPullRequest struct {
BaseModel
InstanceName string `json:"instance_name" `
ProcessID string `json:"process_id" `
}

0 comments on commit 0831c67

Please sign in to comment.