Documentation
¶
Index ¶
- Variables
- func NewNewsEndpoints() []*api.Endpoint
- func RegisterNewsHandler(s server.Server, hdlr NewsHandler, opts ...server.HandlerOption) error
- type Article
- func (*Article) Descriptor() ([]byte, []int)deprecated
- func (x *Article) GetCategories() []string
- func (x *Article) GetDescription() string
- func (x *Article) GetId() string
- func (x *Article) GetImageUrl() string
- func (x *Article) GetKeywords() string
- func (x *Article) GetLanguage() string
- func (x *Article) GetLocale() string
- func (x *Article) GetPublishedAt() string
- func (x *Article) GetSnippet() string
- func (x *Article) GetSource() string
- func (x *Article) GetTitle() string
- func (x *Article) GetUrl() string
- func (*Article) ProtoMessage()
- func (x *Article) ProtoReflect() protoreflect.Message
- func (x *Article) Reset()
- func (x *Article) String() string
- type HeadlinesRequest
- func (*HeadlinesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HeadlinesRequest) GetDate() string
- func (x *HeadlinesRequest) GetLanguage() string
- func (x *HeadlinesRequest) GetLocale() string
- func (*HeadlinesRequest) ProtoMessage()
- func (x *HeadlinesRequest) ProtoReflect() protoreflect.Message
- func (x *HeadlinesRequest) Reset()
- func (x *HeadlinesRequest) String() string
- type HeadlinesResponse
- func (*HeadlinesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HeadlinesResponse) GetArticles() []*Article
- func (*HeadlinesResponse) ProtoMessage()
- func (x *HeadlinesResponse) ProtoReflect() protoreflect.Message
- func (x *HeadlinesResponse) Reset()
- func (x *HeadlinesResponse) String() string
- type NewsHandler
- type NewsService
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_news_proto protoreflect.FileDescriptor
Functions ¶
func NewNewsEndpoints ¶
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) GetCategories ¶
func (*Article) GetDescription ¶
func (*Article) GetImageUrl ¶
func (*Article) GetKeywords ¶
func (*Article) GetLanguage ¶
func (*Article) GetPublishedAt ¶
func (*Article) GetSnippet ¶
func (*Article) ProtoMessage ¶
func (*Article) ProtoMessage()
func (*Article) ProtoReflect ¶
func (x *Article) ProtoReflect() protoreflect.Message
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
Click to show internal directories.
Click to hide internal directories.