handler

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Locales = []string{
		"ar",
		"am",
		"au",
		"at",
		"by",
		"be",
		"bo",
		"br",
		"bg",
		"ca",
		"cl",
		"cn",
		"co",
		"hr",
		"cz",
		"ec",
		"eg",
		"fr",
		"de",
		"gr",
		"hn",
		"hk",
		"in",
		"id",
		"ir",
		"ie",
		"il",
		"it",
		"jp",
		"kr",
		"mx",
		"nl",
		"nz",
		"ni",
		"pk",
		"pa",
		"pe",
		"pl",
		"pt",
		"qa",
		"ro",
		"ru",
		"sa",
		"za",
		"es",
		"ch",
		"sy",
		"tw",
		"th",
		"tr",
		"ua",
		"gb",
		"us",
		"uy",
		"ve",
	}
)

Functions

This section is empty.

Types

type Article

type Article struct {
	UUID        string     `json:"uuid,omitempty"`
	Title       string     `json:"title,omitempty"`
	Description string     `json:"description,omitempty"`
	Keywords    string     `json:"keywords,omitempty"`
	Snippet     string     `json:"snippet,omitempty"`
	Url         string     `json:"url,omitempty"`
	ImageUrl    string     `json:"image_url,omitempty"`
	PublishedAt string     `json:"published_at,omitempty"`
	Source      string     `json:"source,omitempty"`
	Categories  []string   `json:"categories,omitempty"`
	Language    string     `json:"language,omitempty"`
	Locale      string     `json:"locale,omitempty"`
	Similar     []*Article `json:"similar,omitempty"`
}

type Headlines

type Headlines struct {
	Data map[string][]*Article `json:"data"`
}

type News

type News struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string) *News

func (*News) Headlines

func (n *News) Headlines(ctx context.Context, req *pb.HeadlinesRequest, rsp *pb.HeadlinesResponse) error

func (*News) TopStories added in v1.4.0

func (n *News) TopStories(ctx context.Context, req *pb.TopStoriesRequest, rsp *pb.TopStoriesResponse) error

type TopStories added in v1.4.0

type TopStories struct {
	Data []*Article `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL