news

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 11 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 File_proto_news_proto protoreflect.FileDescriptor

Functions

func NewNewsEndpoints

func NewNewsEndpoints() []*api.Endpoint

func RegisterNewsHandler

func RegisterNewsHandler(s server.Server, hdlr NewsHandler, opts ...server.HandlerOption) error

Types

type Article

type Article struct {

	// article id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// article title
	Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	// article description
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// related keywords
	Keywords string `protobuf:"bytes,4,opt,name=keywords,proto3" json:"keywords,omitempty"`
	// first 60 characters of article body
	Snippet string `protobuf:"bytes,5,opt,name=snippet,proto3" json:"snippet,omitempty"`
	// url of the article
	Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"`
	// image url
	ImageUrl string `protobuf:"bytes,7,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
	// time it was published
	PublishedAt string `protobuf:"bytes,8,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"`
	// source of news
	Source string `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"`
	// categories
	Categories []string `protobuf:"bytes,10,rep,name=categories,proto3" json:"categories,omitempty"`
	// the article language
	Language string `protobuf:"bytes,11,opt,name=language,proto3" json:"language,omitempty"`
	// the locale
	Locale string `protobuf:"bytes,12,opt,name=locale,proto3" json:"locale,omitempty"`
	// contains filtered or unexported fields
}

func (*Article) Descriptor deprecated

func (*Article) Descriptor() ([]byte, []int)

Deprecated: Use Article.ProtoReflect.Descriptor instead.

func (*Article) GetCategories

func (x *Article) GetCategories() []string

func (*Article) GetDescription

func (x *Article) GetDescription() string

func (*Article) GetId

func (x *Article) GetId() string

func (*Article) GetImageUrl

func (x *Article) GetImageUrl() string

func (*Article) GetKeywords

func (x *Article) GetKeywords() string

func (*Article) GetLanguage

func (x *Article) GetLanguage() string

func (*Article) GetLocale

func (x *Article) GetLocale() string

func (*Article) GetPublishedAt

func (x *Article) GetPublishedAt() string

func (*Article) GetSnippet

func (x *Article) GetSnippet() string

func (*Article) GetSource

func (x *Article) GetSource() string

func (*Article) GetTitle

func (x *Article) GetTitle() string

func (*Article) GetUrl

func (x *Article) GetUrl() string

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) ProtoReflect

func (x *Article) ProtoReflect() protoreflect.Message

func (*Article) Reset

func (x *Article) Reset()

func (*Article) String

func (x *Article) String() string

type HeadlinesRequest

type HeadlinesRequest struct {

	// comma separated list of languages to retrieve in e.g en,es
	Language string `protobuf:"bytes,1,opt,name=language,proto3" json:"language,omitempty"`
	// comma separated list of countries to include e.g us,ca
	Locale string `protobuf:"bytes,2,opt,name=locale,proto3" json:"locale,omitempty"`
	// date published on in YYYY-MM-DD format
	Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date,omitempty"`
	// contains filtered or unexported fields
}

func (*HeadlinesRequest) Descriptor deprecated

func (*HeadlinesRequest) Descriptor() ([]byte, []int)

Deprecated: Use HeadlinesRequest.ProtoReflect.Descriptor instead.

func (*HeadlinesRequest) GetDate

func (x *HeadlinesRequest) GetDate() string

func (*HeadlinesRequest) GetLanguage

func (x *HeadlinesRequest) GetLanguage() string

func (*HeadlinesRequest) GetLocale

func (x *HeadlinesRequest) GetLocale() string

func (*HeadlinesRequest) ProtoMessage

func (*HeadlinesRequest) ProtoMessage()

func (*HeadlinesRequest) ProtoReflect

func (x *HeadlinesRequest) ProtoReflect() protoreflect.Message

func (*HeadlinesRequest) Reset

func (x *HeadlinesRequest) Reset()

func (*HeadlinesRequest) String

func (x *HeadlinesRequest) String() string

type HeadlinesResponse

type HeadlinesResponse struct {
	Articles []*Article `protobuf:"bytes,1,rep,name=articles,proto3" json:"articles,omitempty"`
	// contains filtered or unexported fields
}

func (*HeadlinesResponse) Descriptor deprecated

func (*HeadlinesResponse) Descriptor() ([]byte, []int)

Deprecated: Use HeadlinesResponse.ProtoReflect.Descriptor instead.

func (*HeadlinesResponse) GetArticles

func (x *HeadlinesResponse) GetArticles() []*Article

func (*HeadlinesResponse) ProtoMessage

func (*HeadlinesResponse) ProtoMessage()

func (*HeadlinesResponse) ProtoReflect

func (x *HeadlinesResponse) ProtoReflect() protoreflect.Message

func (*HeadlinesResponse) Reset

func (x *HeadlinesResponse) Reset()

func (*HeadlinesResponse) String

func (x *HeadlinesResponse) String() string

type NewsHandler

type NewsHandler interface {
	Headlines(context.Context, *HeadlinesRequest, *HeadlinesResponse) error
}

type NewsService

type NewsService interface {
	Headlines(ctx context.Context, in *HeadlinesRequest, opts ...client.CallOption) (*HeadlinesResponse, error)
}

func NewNewsService

func NewNewsService(name string, c client.Client) NewsService

Jump to

Keyboard shortcuts

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