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: 0

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