Documentation
¶
Overview ¶
Package api is a generated protocol buffer package.
It is generated from these files:
service.proto
It has these top-level messages:
GetMostPopularResourceTypeSectionTimeframeRequest CatResult CatsResponse MostPopularResponse MostPopularResult
Index ¶
- func New(cfg Config) kit.Service
- func RegisterApiServiceServer(s *grpc.Server, srv ApiServiceServer)
- type ApiServiceClient
- type ApiServiceServer
- type CatResult
- type CatsResponse
- type Config
- type GetMostPopularResourceTypeSectionTimeframeRequest
- func (*GetMostPopularResourceTypeSectionTimeframeRequest) Descriptor() ([]byte, []int)
- func (m *GetMostPopularResourceTypeSectionTimeframeRequest) GetResourceType() string
- func (m *GetMostPopularResourceTypeSectionTimeframeRequest) GetSection() string
- func (m *GetMostPopularResourceTypeSectionTimeframeRequest) GetTimeframe() int32
- func (*GetMostPopularResourceTypeSectionTimeframeRequest) ProtoMessage()
- func (m *GetMostPopularResourceTypeSectionTimeframeRequest) Reset()
- func (m *GetMostPopularResourceTypeSectionTimeframeRequest) String() string
- type MostPopularResponse
- func (*MostPopularResponse) Descriptor() ([]byte, []int)
- func (m *MostPopularResponse) GetNumResults() uint32
- func (m *MostPopularResponse) GetResults() []*MostPopularResult
- func (m *MostPopularResponse) GetStatus() string
- func (*MostPopularResponse) ProtoMessage()
- func (m *MostPopularResponse) Reset()
- func (m *MostPopularResponse) String() string
- type MostPopularResult
- func (*MostPopularResult) Descriptor() ([]byte, []int)
- func (m *MostPopularResult) GetAbstract() string
- func (m *MostPopularResult) GetAssetID() uint64
- func (m *MostPopularResult) GetByline() string
- func (m *MostPopularResult) GetColumn() string
- func (m *MostPopularResult) GetID() uint64
- func (m *MostPopularResult) GetKeywords() string
- func (m *MostPopularResult) GetPublishedDate() string
- func (m *MostPopularResult) GetSection() string
- func (m *MostPopularResult) GetSource() string
- func (m *MostPopularResult) GetTitle() string
- func (m *MostPopularResult) GetType() string
- func (m *MostPopularResult) GetURL() string
- func (*MostPopularResult) ProtoMessage()
- func (m *MostPopularResult) Reset()
- func (m *MostPopularResult) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterApiServiceServer ¶
func RegisterApiServiceServer(s *grpc.Server, srv ApiServiceServer)
Types ¶
type ApiServiceClient ¶
type ApiServiceClient interface {
// Request recent articles about cats.
GetCats(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*CatsResponse, error)
// Request the most popular articles.
GetMostPopularResourceTypeSectionTimeframe(ctx context.Context, in *GetMostPopularResourceTypeSectionTimeframeRequest, opts ...grpc.CallOption) (*MostPopularResponse, error)
}
func NewApiServiceClient ¶
func NewApiServiceClient(cc *grpc.ClientConn) ApiServiceClient
type ApiServiceServer ¶
type ApiServiceServer interface {
// Request recent articles about cats.
GetCats(context.Context, *google_protobuf.Empty) (*CatsResponse, error)
// Request the most popular articles.
GetMostPopularResourceTypeSectionTimeframe(context.Context, *GetMostPopularResourceTypeSectionTimeframeRequest) (*MostPopularResponse, error)
}
type CatResult ¶
type CatResult struct {
Body string `protobuf:"bytes,4,opt,name=Body" json:"Body,omitempty"`
Byline string `protobuf:"bytes,3,opt,name=Byline" json:"Byline,omitempty"`
Title string `protobuf:"bytes,2,opt,name=Title" json:"Title,omitempty"`
URL string `protobuf:"bytes,1,opt,name=URL" json:"URL,omitempty"`
}
func (*CatResult) Descriptor ¶
func (*CatResult) ProtoMessage ¶
func (*CatResult) ProtoMessage()
type CatsResponse ¶
type CatsResponse struct {
NumResults uint32 `protobuf:"varint,2,opt,name=NumResults" json:"NumResults,omitempty"`
Results []*CatResult `protobuf:"bytes,3,rep,name=Results" json:"Results,omitempty"`
Status string `protobuf:"bytes,1,opt,name=Status" json:"Status,omitempty"`
}
func (*CatsResponse) Descriptor ¶
func (*CatsResponse) Descriptor() ([]byte, []int)
func (*CatsResponse) GetNumResults ¶
func (m *CatsResponse) GetNumResults() uint32
func (*CatsResponse) GetResults ¶
func (m *CatsResponse) GetResults() []*CatResult
func (*CatsResponse) GetStatus ¶
func (m *CatsResponse) GetStatus() string
func (*CatsResponse) ProtoMessage ¶
func (*CatsResponse) ProtoMessage()
func (*CatsResponse) Reset ¶
func (m *CatsResponse) Reset()
func (*CatsResponse) String ¶
func (m *CatsResponse) String() string
type Config ¶
type Config struct {
MostPopularToken string `envconfig:"MOST_POPULAR_TOKEN"`
SemanticToken string `envconfig:"SEMANTIC_TOKEN"`
}
Config is a struct to contain all the needed configuration for our Service
type GetMostPopularResourceTypeSectionTimeframeRequest ¶
type GetMostPopularResourceTypeSectionTimeframeRequest struct {
// mostemailed|mostviewed|mostshared
ResourceType string `protobuf:"bytes,1,opt,name=ResourceType" json:"ResourceType,omitempty"`
// ie. Style, Arts, Books, Opinion
Section string `protobuf:"bytes,2,opt,name=Section" json:"Section,omitempty"`
// days to include. 1, 7 or 30
Timeframe int32 `protobuf:"varint,3,opt,name=Timeframe" json:"Timeframe,omitempty"`
}
func (*GetMostPopularResourceTypeSectionTimeframeRequest) Descriptor ¶
func (*GetMostPopularResourceTypeSectionTimeframeRequest) Descriptor() ([]byte, []int)
func (*GetMostPopularResourceTypeSectionTimeframeRequest) GetResourceType ¶
func (m *GetMostPopularResourceTypeSectionTimeframeRequest) GetResourceType() string
func (*GetMostPopularResourceTypeSectionTimeframeRequest) GetSection ¶
func (m *GetMostPopularResourceTypeSectionTimeframeRequest) GetSection() string
func (*GetMostPopularResourceTypeSectionTimeframeRequest) GetTimeframe ¶
func (m *GetMostPopularResourceTypeSectionTimeframeRequest) GetTimeframe() int32
func (*GetMostPopularResourceTypeSectionTimeframeRequest) ProtoMessage ¶
func (*GetMostPopularResourceTypeSectionTimeframeRequest) ProtoMessage()
func (*GetMostPopularResourceTypeSectionTimeframeRequest) Reset ¶
func (m *GetMostPopularResourceTypeSectionTimeframeRequest) Reset()
func (*GetMostPopularResourceTypeSectionTimeframeRequest) String ¶
func (m *GetMostPopularResourceTypeSectionTimeframeRequest) String() string
type MostPopularResponse ¶
type MostPopularResponse struct {
NumResults uint32 `protobuf:"varint,2,opt,name=NumResults" json:"NumResults,omitempty"`
Results []*MostPopularResult `protobuf:"bytes,3,rep,name=Results" json:"Results,omitempty"`
Status string `protobuf:"bytes,1,opt,name=Status" json:"Status,omitempty"`
}
func (*MostPopularResponse) Descriptor ¶
func (*MostPopularResponse) Descriptor() ([]byte, []int)
func (*MostPopularResponse) GetNumResults ¶
func (m *MostPopularResponse) GetNumResults() uint32
func (*MostPopularResponse) GetResults ¶
func (m *MostPopularResponse) GetResults() []*MostPopularResult
func (*MostPopularResponse) GetStatus ¶
func (m *MostPopularResponse) GetStatus() string
func (*MostPopularResponse) ProtoMessage ¶
func (*MostPopularResponse) ProtoMessage()
func (*MostPopularResponse) Reset ¶
func (m *MostPopularResponse) Reset()
func (*MostPopularResponse) String ¶
func (m *MostPopularResponse) String() string
type MostPopularResult ¶
type MostPopularResult struct {
Abstract string `protobuf:"bytes,10,opt,name=Abstract" json:"Abstract,omitempty"`
AssetID uint64 `protobuf:"varint,3,opt,name=AssetID" json:"AssetID,omitempty"`
Byline string `protobuf:"bytes,7,opt,name=Byline" json:"Byline,omitempty"`
Column string `protobuf:"bytes,5,opt,name=Column" json:"Column,omitempty"`
ID uint64 `protobuf:"varint,2,opt,name=ID" json:"ID,omitempty"`
Keywords string `protobuf:"bytes,4,opt,name=Keywords" json:"Keywords,omitempty"`
PublishedDate string `protobuf:"bytes,11,opt,name=PublishedDate" json:"PublishedDate,omitempty"`
Section string `protobuf:"bytes,6,opt,name=Section" json:"Section,omitempty"`
Source string `protobuf:"bytes,12,opt,name=Source" json:"Source,omitempty"`
Title string `protobuf:"bytes,9,opt,name=Title" json:"Title,omitempty"`
Type string `protobuf:"bytes,8,opt,name=Type" json:"Type,omitempty"`
URL string `protobuf:"bytes,1,opt,name=URL" json:"URL,omitempty"`
}
func (*MostPopularResult) Descriptor ¶
func (*MostPopularResult) Descriptor() ([]byte, []int)
func (*MostPopularResult) GetAbstract ¶
func (m *MostPopularResult) GetAbstract() string
func (*MostPopularResult) GetAssetID ¶
func (m *MostPopularResult) GetAssetID() uint64
func (*MostPopularResult) GetByline ¶
func (m *MostPopularResult) GetByline() string
func (*MostPopularResult) GetColumn ¶
func (m *MostPopularResult) GetColumn() string
func (*MostPopularResult) GetID ¶
func (m *MostPopularResult) GetID() uint64
func (*MostPopularResult) GetKeywords ¶
func (m *MostPopularResult) GetKeywords() string
func (*MostPopularResult) GetPublishedDate ¶
func (m *MostPopularResult) GetPublishedDate() string
func (*MostPopularResult) GetSection ¶
func (m *MostPopularResult) GetSection() string
func (*MostPopularResult) GetSource ¶
func (m *MostPopularResult) GetSource() string
func (*MostPopularResult) GetTitle ¶
func (m *MostPopularResult) GetTitle() string
func (*MostPopularResult) GetType ¶
func (m *MostPopularResult) GetType() string
func (*MostPopularResult) GetURL ¶
func (m *MostPopularResult) GetURL() string
func (*MostPopularResult) ProtoMessage ¶
func (*MostPopularResult) ProtoMessage()
func (*MostPopularResult) Reset ¶
func (m *MostPopularResult) Reset()
func (*MostPopularResult) String ¶
func (m *MostPopularResult) String() string
Click to show internal directories.
Click to hide internal directories.