-
Notifications
You must be signed in to change notification settings - Fork 2
/
newsresult.go
30 lines (26 loc) · 886 Bytes
/
newsresult.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2012 Microsoft (data structure).
// Copyright 2016 Erlend Johannessen (code).
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package bingapi
// NewsResult receives a single result from the Bing search.
type NewsResult struct {
MetaData MetaData `json:"__metadata"`
ID string
Title string
URL string `json:"Url"`
Source string
Description string
Date string
}
// NewsResultContainer receives a slice of NewsResult
// and a pre-made URL for getting more results
type NewsResultContainer struct {
Results []NewsResult `json:"results"`
NextPageURL string `json:"__next"`
}
// newsResultWrapper is the outer wrapper for the result.
// Not used for more than receiving the resultcontainer.
type newsResultWrapper struct {
Data NewsResultContainer `json:"d"`
}