Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/umutbasal/antmedia

this is a client pkg for antmedia autogenerated from swagger spec. api version 2.4.3, https://pkg.go.dev/github.com/umutbasal/antmedia
https://github.com/umutbasal/antmedia

Last synced: about 1 month ago
JSON representation

this is a client pkg for antmedia autogenerated from swagger spec. api version 2.4.3, https://pkg.go.dev/github.com/umutbasal/antmedia

Awesome Lists containing this project

README

        

# antmedia

this is a client pkg for antmedia autogenerated from swagger spec.
!! because spec didnt pass validations i made some fixes over.

## Example client usage

### Create broadcast

```go

package main

import (
"fmt"
"log"
"os"
"time"

apiclient "github.com/umutbasal/antmedia/client"
"github.com/umutbasal/antmedia/client/broadcast_rest_service"
models "github.com/umutbasal/antmedia/models"

"github.com/go-openapi/strfmt"
_ "github.com/joho/godotenv/autoload"
)

func main() {

// create the API client, with the transport
client := apiclient.NewHTTPClientWithConfig(strfmt.Default, &apiclient.TransportConfig{
Host: os.Getenv("ANTMEDIA_HOST"),
BasePath: os.Getenv("ANTMEDIA_BASE"),
Schemes: []string{"http"},
})

// to override the host for the default client
// apiclient.Default.SetTransport(transport)

// make the request to get all items
params := broadcast_rest_service.NewCreateBroadcastParamsWithTimeout(time.Second * 10)
params.Body = &models.Broadcast{
Name: "test",
}

resp, err := client.BroadcastRestService.CreateBroadcast(params)
if err != nil {
log.Fatal(err)
}

// rtmp url
fmt.Printf("RTMP: %s", resp.Payload.RtmpURL)

}
```

## Example cli usage

```sh
go run antmedia/cmd/cli broadcast_rest_service getBroadcastList --hostname ${ANTMEDIA_HOST} --base ${ANTMEDIA_BASE} --offset 0 --size 1
00
```