Aleksander Garin
fb9fd9880e
- Add constants - Add default - Add set default for request payload - Fixes
30 lines
617 B
Go
30 lines
617 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
youtubekids "githouse.ru/feelter-ugc/go-youtubekids-client"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
client, err := youtubekids.NewClient(youtubekids.DefaultServerURL)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
response, err := client.Browse(context.TODO(), (&youtubekids.BrowseRequestPayload{
|
|
BrowseId: youtubekids.BrowseIdForKidsHome,
|
|
Context: youtubekids.RequestContext{
|
|
Client: youtubekids.RequestClient{},
|
|
},
|
|
}).SetDefaults())
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
data, err := json.MarshalIndent(response, "", " ")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
log.Println(string(data))
|
|
}
|