Versions in this module Expand all Collapse all v1 v1.1.4 Sep 7, 2022 Changes in this version + const DefaultEndpoint + func UserAgent() string + func Version() string + type Answer struct + FollowUpQueries *[]Query + ID *string + Type Type + WebSearchURL *string + func (a Answer) AsAnswer() (*Answer, bool) + func (a Answer) AsBasicAnswer() (BasicAnswer, bool) + func (a Answer) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (a Answer) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (a Answer) AsBasicResponse() (BasicResponse, bool) + func (a Answer) AsBasicResponseBase() (BasicResponseBase, bool) + func (a Answer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (a Answer) AsBasicThing() (BasicThing, bool) + func (a Answer) AsCreativeWork() (*CreativeWork, bool) + func (a Answer) AsErrorResponse() (*ErrorResponse, bool) + func (a Answer) AsIdentifiable() (*Identifiable, bool) + func (a Answer) AsResponse() (*Response, bool) + func (a Answer) AsResponseBase() (*ResponseBase, bool) + func (a Answer) AsSearchResponse() (*SearchResponse, bool) + func (a Answer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (a Answer) AsThing() (*Thing, bool) + func (a Answer) AsWebPage() (*WebPage, bool) + func (a Answer) AsWebWebAnswer() (*WebWebAnswer, bool) + func (a Answer) MarshalJSON() ([]byte, error) + type BaseClient struct + Endpoint string + func New() BaseClient + func NewWithoutDefaults(endpoint string) BaseClient + type BasicAnswer interface + AsAnswer func() (*Answer, bool) + AsBasicSearchResultsAnswer func() (BasicSearchResultsAnswer, bool) + AsSearchResultsAnswer func() (*SearchResultsAnswer, bool) + AsWebWebAnswer func() (*WebWebAnswer, bool) + type BasicCreativeWork interface + AsCreativeWork func() (*CreativeWork, bool) + AsWebPage func() (*WebPage, bool) + type BasicIdentifiable interface + AsAnswer func() (*Answer, bool) + AsBasicAnswer func() (BasicAnswer, bool) + AsBasicCreativeWork func() (BasicCreativeWork, bool) + AsBasicResponse func() (BasicResponse, bool) + AsBasicSearchResultsAnswer func() (BasicSearchResultsAnswer, bool) + AsBasicThing func() (BasicThing, bool) + AsCreativeWork func() (*CreativeWork, bool) + AsErrorResponse func() (*ErrorResponse, bool) + AsIdentifiable func() (*Identifiable, bool) + AsResponse func() (*Response, bool) + AsSearchResponse func() (*SearchResponse, bool) + AsSearchResultsAnswer func() (*SearchResultsAnswer, bool) + AsThing func() (*Thing, bool) + AsWebPage func() (*WebPage, bool) + AsWebWebAnswer func() (*WebWebAnswer, bool) + type BasicResponse interface + AsAnswer func() (*Answer, bool) + AsBasicAnswer func() (BasicAnswer, bool) + AsBasicCreativeWork func() (BasicCreativeWork, bool) + AsBasicSearchResultsAnswer func() (BasicSearchResultsAnswer, bool) + AsBasicThing func() (BasicThing, bool) + AsCreativeWork func() (*CreativeWork, bool) + AsErrorResponse func() (*ErrorResponse, bool) + AsResponse func() (*Response, bool) + AsSearchResponse func() (*SearchResponse, bool) + AsSearchResultsAnswer func() (*SearchResultsAnswer, bool) + AsThing func() (*Thing, bool) + AsWebPage func() (*WebPage, bool) + AsWebWebAnswer func() (*WebWebAnswer, bool) + type BasicResponseBase interface + AsAnswer func() (*Answer, bool) + AsBasicAnswer func() (BasicAnswer, bool) + AsBasicCreativeWork func() (BasicCreativeWork, bool) + AsBasicIdentifiable func() (BasicIdentifiable, bool) + AsBasicResponse func() (BasicResponse, bool) + AsBasicSearchResultsAnswer func() (BasicSearchResultsAnswer, bool) + AsBasicThing func() (BasicThing, bool) + AsCreativeWork func() (*CreativeWork, bool) + AsErrorResponse func() (*ErrorResponse, bool) + AsIdentifiable func() (*Identifiable, bool) + AsResponse func() (*Response, bool) + AsResponseBase func() (*ResponseBase, bool) + AsSearchResponse func() (*SearchResponse, bool) + AsSearchResultsAnswer func() (*SearchResultsAnswer, bool) + AsThing func() (*Thing, bool) + AsWebPage func() (*WebPage, bool) + AsWebWebAnswer func() (*WebWebAnswer, bool) + type BasicSearchResultsAnswer interface + AsSearchResultsAnswer func() (*SearchResultsAnswer, bool) + AsWebWebAnswer func() (*WebWebAnswer, bool) + type BasicThing interface + AsBasicCreativeWork func() (BasicCreativeWork, bool) + AsCreativeWork func() (*CreativeWork, bool) + AsThing func() (*Thing, bool) + AsWebPage func() (*WebPage, bool) + type CreativeWork struct + BingID *string + Description *string + ID *string + Name *string + Provider *[]BasicThing + Text *string + ThumbnailURL *string + Type Type + URL *string + WebSearchURL *string + func (cw *CreativeWork) UnmarshalJSON(body []byte) error + func (cw CreativeWork) AsAnswer() (*Answer, bool) + func (cw CreativeWork) AsBasicAnswer() (BasicAnswer, bool) + func (cw CreativeWork) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (cw CreativeWork) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (cw CreativeWork) AsBasicResponse() (BasicResponse, bool) + func (cw CreativeWork) AsBasicResponseBase() (BasicResponseBase, bool) + func (cw CreativeWork) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (cw CreativeWork) AsBasicThing() (BasicThing, bool) + func (cw CreativeWork) AsCreativeWork() (*CreativeWork, bool) + func (cw CreativeWork) AsErrorResponse() (*ErrorResponse, bool) + func (cw CreativeWork) AsIdentifiable() (*Identifiable, bool) + func (cw CreativeWork) AsResponse() (*Response, bool) + func (cw CreativeWork) AsResponseBase() (*ResponseBase, bool) + func (cw CreativeWork) AsSearchResponse() (*SearchResponse, bool) + func (cw CreativeWork) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (cw CreativeWork) AsThing() (*Thing, bool) + func (cw CreativeWork) AsWebPage() (*WebPage, bool) + func (cw CreativeWork) AsWebWebAnswer() (*WebWebAnswer, bool) + func (cw CreativeWork) MarshalJSON() ([]byte, error) + type CustomInstanceClient struct + func NewCustomInstanceClient() CustomInstanceClient + func (client CustomInstanceClient) Search(ctx context.Context, customConfig string, query string, acceptLanguage string, ...) (result SearchResponse, err error) + func (client CustomInstanceClient) SearchPreparer(ctx context.Context, customConfig string, query string, acceptLanguage string, ...) (*http.Request, error) + func (client CustomInstanceClient) SearchResponder(resp *http.Response) (result SearchResponse, err error) + func (client CustomInstanceClient) SearchSender(req *http.Request) (*http.Response, error) + type Error struct + Code ErrorCode + Message *string + MoreDetails *string + Parameter *string + SubCode ErrorSubCode + Value *string + func (e Error) MarshalJSON() ([]byte, error) + type ErrorCode string + const InsufficientAuthorization + const InvalidAuthorization + const InvalidRequest + const None + const RateLimitExceeded + const ServerError + func PossibleErrorCodeValues() []ErrorCode + type ErrorResponse struct + Errors *[]Error + ID *string + Type Type + WebSearchURL *string + func (er ErrorResponse) AsAnswer() (*Answer, bool) + func (er ErrorResponse) AsBasicAnswer() (BasicAnswer, bool) + func (er ErrorResponse) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (er ErrorResponse) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (er ErrorResponse) AsBasicResponse() (BasicResponse, bool) + func (er ErrorResponse) AsBasicResponseBase() (BasicResponseBase, bool) + func (er ErrorResponse) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (er ErrorResponse) AsBasicThing() (BasicThing, bool) + func (er ErrorResponse) AsCreativeWork() (*CreativeWork, bool) + func (er ErrorResponse) AsErrorResponse() (*ErrorResponse, bool) + func (er ErrorResponse) AsIdentifiable() (*Identifiable, bool) + func (er ErrorResponse) AsResponse() (*Response, bool) + func (er ErrorResponse) AsResponseBase() (*ResponseBase, bool) + func (er ErrorResponse) AsSearchResponse() (*SearchResponse, bool) + func (er ErrorResponse) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (er ErrorResponse) AsThing() (*Thing, bool) + func (er ErrorResponse) AsWebPage() (*WebPage, bool) + func (er ErrorResponse) AsWebWebAnswer() (*WebWebAnswer, bool) + func (er ErrorResponse) MarshalJSON() ([]byte, error) + type ErrorSubCode string + const AuthorizationDisabled + const AuthorizationExpired + const AuthorizationMissing + const AuthorizationRedundancy + const Blocked + const HTTPNotAllowed + const NotImplemented + const ParameterInvalidValue + const ParameterMissing + const ResourceError + const UnexpectedError + func PossibleErrorSubCodeValues() []ErrorSubCode + type Identifiable struct + ID *string + Type Type + func (i Identifiable) AsAnswer() (*Answer, bool) + func (i Identifiable) AsBasicAnswer() (BasicAnswer, bool) + func (i Identifiable) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (i Identifiable) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (i Identifiable) AsBasicResponse() (BasicResponse, bool) + func (i Identifiable) AsBasicResponseBase() (BasicResponseBase, bool) + func (i Identifiable) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (i Identifiable) AsBasicThing() (BasicThing, bool) + func (i Identifiable) AsCreativeWork() (*CreativeWork, bool) + func (i Identifiable) AsErrorResponse() (*ErrorResponse, bool) + func (i Identifiable) AsIdentifiable() (*Identifiable, bool) + func (i Identifiable) AsResponse() (*Response, bool) + func (i Identifiable) AsResponseBase() (*ResponseBase, bool) + func (i Identifiable) AsSearchResponse() (*SearchResponse, bool) + func (i Identifiable) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (i Identifiable) AsThing() (*Thing, bool) + func (i Identifiable) AsWebPage() (*WebPage, bool) + func (i Identifiable) AsWebWebAnswer() (*WebWebAnswer, bool) + func (i Identifiable) MarshalJSON() ([]byte, error) + type Query struct + DisplayText *string + SearchLink *string + Text *string + WebSearchURL *string + func (q Query) MarshalJSON() ([]byte, error) + type QueryContext struct + AdultIntent *bool + AlterationOverrideQuery *string + AlteredQuery *string + OriginalQuery *string + func (qc QueryContext) MarshalJSON() ([]byte, error) + type Response struct + ID *string + Type Type + WebSearchURL *string + func (r Response) AsAnswer() (*Answer, bool) + func (r Response) AsBasicAnswer() (BasicAnswer, bool) + func (r Response) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (r Response) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (r Response) AsBasicResponse() (BasicResponse, bool) + func (r Response) AsBasicResponseBase() (BasicResponseBase, bool) + func (r Response) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (r Response) AsBasicThing() (BasicThing, bool) + func (r Response) AsCreativeWork() (*CreativeWork, bool) + func (r Response) AsErrorResponse() (*ErrorResponse, bool) + func (r Response) AsIdentifiable() (*Identifiable, bool) + func (r Response) AsResponse() (*Response, bool) + func (r Response) AsResponseBase() (*ResponseBase, bool) + func (r Response) AsSearchResponse() (*SearchResponse, bool) + func (r Response) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (r Response) AsThing() (*Thing, bool) + func (r Response) AsWebPage() (*WebPage, bool) + func (r Response) AsWebWebAnswer() (*WebWebAnswer, bool) + func (r Response) MarshalJSON() ([]byte, error) + type ResponseBase struct + Type Type + func (rb ResponseBase) AsAnswer() (*Answer, bool) + func (rb ResponseBase) AsBasicAnswer() (BasicAnswer, bool) + func (rb ResponseBase) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (rb ResponseBase) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (rb ResponseBase) AsBasicResponse() (BasicResponse, bool) + func (rb ResponseBase) AsBasicResponseBase() (BasicResponseBase, bool) + func (rb ResponseBase) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (rb ResponseBase) AsBasicThing() (BasicThing, bool) + func (rb ResponseBase) AsCreativeWork() (*CreativeWork, bool) + func (rb ResponseBase) AsErrorResponse() (*ErrorResponse, bool) + func (rb ResponseBase) AsIdentifiable() (*Identifiable, bool) + func (rb ResponseBase) AsResponse() (*Response, bool) + func (rb ResponseBase) AsResponseBase() (*ResponseBase, bool) + func (rb ResponseBase) AsSearchResponse() (*SearchResponse, bool) + func (rb ResponseBase) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (rb ResponseBase) AsThing() (*Thing, bool) + func (rb ResponseBase) AsWebPage() (*WebPage, bool) + func (rb ResponseBase) AsWebWebAnswer() (*WebWebAnswer, bool) + func (rb ResponseBase) MarshalJSON() ([]byte, error) + type SafeSearch string + const Moderate + const Off + const Strict + func PossibleSafeSearchValues() []SafeSearch + type SearchResponse struct + ID *string + QueryContext *QueryContext + Type Type + WebPages *WebWebAnswer + WebSearchURL *string + func (sr SearchResponse) AsAnswer() (*Answer, bool) + func (sr SearchResponse) AsBasicAnswer() (BasicAnswer, bool) + func (sr SearchResponse) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (sr SearchResponse) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (sr SearchResponse) AsBasicResponse() (BasicResponse, bool) + func (sr SearchResponse) AsBasicResponseBase() (BasicResponseBase, bool) + func (sr SearchResponse) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (sr SearchResponse) AsBasicThing() (BasicThing, bool) + func (sr SearchResponse) AsCreativeWork() (*CreativeWork, bool) + func (sr SearchResponse) AsErrorResponse() (*ErrorResponse, bool) + func (sr SearchResponse) AsIdentifiable() (*Identifiable, bool) + func (sr SearchResponse) AsResponse() (*Response, bool) + func (sr SearchResponse) AsResponseBase() (*ResponseBase, bool) + func (sr SearchResponse) AsSearchResponse() (*SearchResponse, bool) + func (sr SearchResponse) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (sr SearchResponse) AsThing() (*Thing, bool) + func (sr SearchResponse) AsWebPage() (*WebPage, bool) + func (sr SearchResponse) AsWebWebAnswer() (*WebWebAnswer, bool) + func (sr SearchResponse) MarshalJSON() ([]byte, error) + type SearchResultsAnswer struct + FollowUpQueries *[]Query + ID *string + IsFamilyFriendly *bool + QueryContext *QueryContext + TotalEstimatedMatches *int64 + Type Type + WebSearchURL *string + func (sra SearchResultsAnswer) AsAnswer() (*Answer, bool) + func (sra SearchResultsAnswer) AsBasicAnswer() (BasicAnswer, bool) + func (sra SearchResultsAnswer) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (sra SearchResultsAnswer) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (sra SearchResultsAnswer) AsBasicResponse() (BasicResponse, bool) + func (sra SearchResultsAnswer) AsBasicResponseBase() (BasicResponseBase, bool) + func (sra SearchResultsAnswer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (sra SearchResultsAnswer) AsBasicThing() (BasicThing, bool) + func (sra SearchResultsAnswer) AsCreativeWork() (*CreativeWork, bool) + func (sra SearchResultsAnswer) AsErrorResponse() (*ErrorResponse, bool) + func (sra SearchResultsAnswer) AsIdentifiable() (*Identifiable, bool) + func (sra SearchResultsAnswer) AsResponse() (*Response, bool) + func (sra SearchResultsAnswer) AsResponseBase() (*ResponseBase, bool) + func (sra SearchResultsAnswer) AsSearchResponse() (*SearchResponse, bool) + func (sra SearchResultsAnswer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (sra SearchResultsAnswer) AsThing() (*Thing, bool) + func (sra SearchResultsAnswer) AsWebPage() (*WebPage, bool) + func (sra SearchResultsAnswer) AsWebWebAnswer() (*WebWebAnswer, bool) + func (sra SearchResultsAnswer) MarshalJSON() ([]byte, error) + type TextFormat string + const HTML + const Raw + func PossibleTextFormatValues() []TextFormat + type Thing struct + BingID *string + Description *string + ID *string + Name *string + Type Type + URL *string + WebSearchURL *string + func (t Thing) AsAnswer() (*Answer, bool) + func (t Thing) AsBasicAnswer() (BasicAnswer, bool) + func (t Thing) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (t Thing) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (t Thing) AsBasicResponse() (BasicResponse, bool) + func (t Thing) AsBasicResponseBase() (BasicResponseBase, bool) + func (t Thing) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (t Thing) AsBasicThing() (BasicThing, bool) + func (t Thing) AsCreativeWork() (*CreativeWork, bool) + func (t Thing) AsErrorResponse() (*ErrorResponse, bool) + func (t Thing) AsIdentifiable() (*Identifiable, bool) + func (t Thing) AsResponse() (*Response, bool) + func (t Thing) AsResponseBase() (*ResponseBase, bool) + func (t Thing) AsSearchResponse() (*SearchResponse, bool) + func (t Thing) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (t Thing) AsThing() (*Thing, bool) + func (t Thing) AsWebPage() (*WebPage, bool) + func (t Thing) AsWebWebAnswer() (*WebWebAnswer, bool) + func (t Thing) MarshalJSON() ([]byte, error) + type Type string + const TypeAnswer + const TypeCreativeWork + const TypeErrorResponse + const TypeIdentifiable + const TypeResponse + const TypeResponseBase + const TypeSearchResponse + const TypeSearchResultsAnswer + const TypeThing + const TypeWebPage + const TypeWebWebAnswer + func PossibleTypeValues() []Type + type WebMetaTag struct + Content *string + Name *string + func (wmt WebMetaTag) MarshalJSON() ([]byte, error) + type WebPage struct + BingID *string + DateLastCrawled *string + DeepLinks *[]WebPage + Description *string + DisplayURL *string + ID *string + Name *string + Provider *[]BasicThing + SearchTags *[]WebMetaTag + Snippet *string + Text *string + ThumbnailURL *string + Type Type + URL *string + WebSearchURL *string + func (wp *WebPage) UnmarshalJSON(body []byte) error + func (wp WebPage) AsAnswer() (*Answer, bool) + func (wp WebPage) AsBasicAnswer() (BasicAnswer, bool) + func (wp WebPage) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (wp WebPage) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (wp WebPage) AsBasicResponse() (BasicResponse, bool) + func (wp WebPage) AsBasicResponseBase() (BasicResponseBase, bool) + func (wp WebPage) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (wp WebPage) AsBasicThing() (BasicThing, bool) + func (wp WebPage) AsCreativeWork() (*CreativeWork, bool) + func (wp WebPage) AsErrorResponse() (*ErrorResponse, bool) + func (wp WebPage) AsIdentifiable() (*Identifiable, bool) + func (wp WebPage) AsResponse() (*Response, bool) + func (wp WebPage) AsResponseBase() (*ResponseBase, bool) + func (wp WebPage) AsSearchResponse() (*SearchResponse, bool) + func (wp WebPage) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (wp WebPage) AsThing() (*Thing, bool) + func (wp WebPage) AsWebPage() (*WebPage, bool) + func (wp WebPage) AsWebWebAnswer() (*WebWebAnswer, bool) + func (wp WebPage) MarshalJSON() ([]byte, error) + type WebWebAnswer struct + FollowUpQueries *[]Query + ID *string + IsFamilyFriendly *bool + QueryContext *QueryContext + SomeResultsRemoved *bool + TotalEstimatedMatches *int64 + Type Type + Value *[]WebPage + WebSearchURL *string + func (wwa WebWebAnswer) AsAnswer() (*Answer, bool) + func (wwa WebWebAnswer) AsBasicAnswer() (BasicAnswer, bool) + func (wwa WebWebAnswer) AsBasicCreativeWork() (BasicCreativeWork, bool) + func (wwa WebWebAnswer) AsBasicIdentifiable() (BasicIdentifiable, bool) + func (wwa WebWebAnswer) AsBasicResponse() (BasicResponse, bool) + func (wwa WebWebAnswer) AsBasicResponseBase() (BasicResponseBase, bool) + func (wwa WebWebAnswer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + func (wwa WebWebAnswer) AsBasicThing() (BasicThing, bool) + func (wwa WebWebAnswer) AsCreativeWork() (*CreativeWork, bool) + func (wwa WebWebAnswer) AsErrorResponse() (*ErrorResponse, bool) + func (wwa WebWebAnswer) AsIdentifiable() (*Identifiable, bool) + func (wwa WebWebAnswer) AsResponse() (*Response, bool) + func (wwa WebWebAnswer) AsResponseBase() (*ResponseBase, bool) + func (wwa WebWebAnswer) AsSearchResponse() (*SearchResponse, bool) + func (wwa WebWebAnswer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + func (wwa WebWebAnswer) AsThing() (*Thing, bool) + func (wwa WebWebAnswer) AsWebPage() (*WebPage, bool) + func (wwa WebWebAnswer) AsWebWebAnswer() (*WebWebAnswer, bool) + func (wwa WebWebAnswer) MarshalJSON() ([]byte, error)