You've already forked go-youtubekids-client
- Upgrade schema
- Add constants - Add default - Add set default for request payload - Fixes
This commit is contained in:
29
examples/browse/main.go
Normal file
29
examples/browse/main.go
Normal file
@ -0,0 +1,29 @@
|
||||
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))
|
||||
}
|
Reference in New Issue
Block a user