Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/umutbasal/antmedia
- Owner: umutbasal
- License: mit
- Created: 2022-07-28T23:04:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-29T01:20:07.000Z (over 2 years ago)
- Last Synced: 2024-06-20T08:19:02.584Z (5 months ago)
- Homepage:
- Size: 460 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```