add further accessor methods to feeds (#51)

This commit is contained in:
Asim Aslam
2021-01-27 20:04:48 +00:00
committed by GitHub
parent 78f9ad4422
commit 9e7d7b7e34
4 changed files with 466 additions and 430 deletions

View File

@@ -4,6 +4,7 @@ import (
"context" "context"
"time" "time"
"github.com/micro/micro/v3/service/errors"
log "github.com/micro/micro/v3/service/logger" log "github.com/micro/micro/v3/service/logger"
"github.com/micro/micro/v3/service/model" "github.com/micro/micro/v3/service/model"
@@ -69,7 +70,7 @@ func (e *Feeds) crawl() {
} }
} }
func (e *Feeds) New(ctx context.Context, req *feeds.NewRequest, rsp *feeds.NewResponse) error { func (e *Feeds) Add(ctx context.Context, req *feeds.AddRequest, rsp *feeds.AddResponse) error {
log.Info("Received Feeds.New request") log.Info("Received Feeds.New request")
e.feeds.Create(feeds.Feed{ e.feeds.Create(feeds.Feed{
Name: req.Name, Name: req.Name,
@@ -86,3 +87,24 @@ func (e *Feeds) Entries(ctx context.Context, req *feeds.EntriesRequest, rsp *fee
} }
return e.entries.Read(e.entriesURLIndex.ToQuery(req.Url), &rsp.Entries) return e.entries.Read(e.entriesURLIndex.ToQuery(req.Url), &rsp.Entries)
} }
func (e *Feeds) List(ctx context.Context, req *feeds.ListRequest, rsp *feeds.ListResponse) error {
var feeds []*feeds.Feed
err := e.feeds.Read(model.QueryAll(), &feeds)
if err != nil {
return errors.InternalServerError("feeds.list", "failed to read list of feeds: %v", err)
}
rsp.Feeds = feeds
return nil
}
func (e *Feeds) Remove(ctx context.Context, req *feeds.RemoveRequest, rsp *feeds.RemoveResponse) error {
if len(req.Name) == 0 {
return errors.BadRequest("feeds.remove", "blank name provided")
}
e.feeds.Delete(model.QueryEquals("name", req.Name))
return nil
}

View File

@@ -1,535 +1,497 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.6.1
// source: proto/feeds.proto // source: proto/feeds.proto
package feeds package feeds
import ( import (
fmt "fmt"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" math "math"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( // Reference imports to suppress errors if they are not otherwise used.
// Verify that this generated code is sufficiently up-to-date. var _ = proto.Marshal
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) var _ = fmt.Errorf
// Verify that runtime/protoimpl is sufficiently up-to-date. var _ = math.Inf
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version // This is a compile-time assertion to ensure that this generated file
// of the legacy proto package is being used. // is compatible with the proto package it is being compiled against.
const _ = proto.ProtoPackageIsVersion4 // A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Feed struct { type Feed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// rss feed name // rss feed name
// eg. a16z // eg. a16z
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// rss feed url // rss feed url
// eg. http://a16z.com/feed/ // eg. http://a16z.com/feed/
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (x *Feed) Reset() { func (m *Feed) Reset() { *m = Feed{} }
*x = Feed{} func (m *Feed) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*Feed) ProtoMessage() {}
mi := &file_proto_feeds_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Feed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Feed) ProtoMessage() {}
func (x *Feed) ProtoReflect() protoreflect.Message {
mi := &file_proto_feeds_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Feed.ProtoReflect.Descriptor instead.
func (*Feed) Descriptor() ([]byte, []int) { func (*Feed) Descriptor() ([]byte, []int) {
return file_proto_feeds_proto_rawDescGZIP(), []int{0} return fileDescriptor_dd517c38176c13bf, []int{0}
} }
func (x *Feed) GetName() string { func (m *Feed) XXX_Unmarshal(b []byte) error {
if x != nil { return xxx_messageInfo_Feed.Unmarshal(m, b)
return x.Name }
func (m *Feed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Feed.Marshal(b, m, deterministic)
}
func (m *Feed) XXX_Merge(src proto.Message) {
xxx_messageInfo_Feed.Merge(m, src)
}
func (m *Feed) XXX_Size() int {
return xxx_messageInfo_Feed.Size(m)
}
func (m *Feed) XXX_DiscardUnknown() {
xxx_messageInfo_Feed.DiscardUnknown(m)
}
var xxx_messageInfo_Feed proto.InternalMessageInfo
func (m *Feed) GetName() string {
if m != nil {
return m.Name
} }
return "" return ""
} }
func (x *Feed) GetUrl() string { func (m *Feed) GetUrl() string {
if x != nil { if m != nil {
return x.Url return m.Url
} }
return "" return ""
} }
type Entry struct { type Entry struct {
state protoimpl.MessageState Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
sizeCache protoimpl.SizeCache Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
unknownFields protoimpl.UnknownFields Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` Date int64 `protobuf:"varint,6,opt,name=date,proto3" json:"date,omitempty"`
Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` XXX_unrecognized []byte `json:"-"`
Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` XXX_sizecache int32 `json:"-"`
Date int64 `protobuf:"varint,6,opt,name=date,proto3" json:"date,omitempty"`
} }
func (x *Entry) Reset() { func (m *Entry) Reset() { *m = Entry{} }
*x = Entry{} func (m *Entry) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*Entry) ProtoMessage() {}
mi := &file_proto_feeds_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Entry) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Entry) ProtoMessage() {}
func (x *Entry) ProtoReflect() protoreflect.Message {
mi := &file_proto_feeds_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Entry.ProtoReflect.Descriptor instead.
func (*Entry) Descriptor() ([]byte, []int) { func (*Entry) Descriptor() ([]byte, []int) {
return file_proto_feeds_proto_rawDescGZIP(), []int{1} return fileDescriptor_dd517c38176c13bf, []int{1}
} }
func (x *Entry) GetId() string { func (m *Entry) XXX_Unmarshal(b []byte) error {
if x != nil { return xxx_messageInfo_Entry.Unmarshal(m, b)
return x.Id }
func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Entry.Marshal(b, m, deterministic)
}
func (m *Entry) XXX_Merge(src proto.Message) {
xxx_messageInfo_Entry.Merge(m, src)
}
func (m *Entry) XXX_Size() int {
return xxx_messageInfo_Entry.Size(m)
}
func (m *Entry) XXX_DiscardUnknown() {
xxx_messageInfo_Entry.DiscardUnknown(m)
}
var xxx_messageInfo_Entry proto.InternalMessageInfo
func (m *Entry) GetId() string {
if m != nil {
return m.Id
} }
return "" return ""
} }
func (x *Entry) GetDomain() string { func (m *Entry) GetDomain() string {
if x != nil { if m != nil {
return x.Domain return m.Domain
} }
return "" return ""
} }
func (x *Entry) GetUrl() string { func (m *Entry) GetUrl() string {
if x != nil { if m != nil {
return x.Url return m.Url
} }
return "" return ""
} }
func (x *Entry) GetTitle() string { func (m *Entry) GetTitle() string {
if x != nil { if m != nil {
return x.Title return m.Title
} }
return "" return ""
} }
func (x *Entry) GetContent() string { func (m *Entry) GetContent() string {
if x != nil { if m != nil {
return x.Content return m.Content
} }
return "" return ""
} }
func (x *Entry) GetDate() int64 { func (m *Entry) GetDate() int64 {
if x != nil { if m != nil {
return x.Date return m.Date
} }
return 0 return 0
} }
type NewRequest struct { type AddRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// rss feed name // rss feed name
// eg. a16z // eg. a16z
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// rss feed url // rss feed url
// eg. http://a16z.com/feed/ // eg. http://a16z.com/feed/
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (x *NewRequest) Reset() { func (m *AddRequest) Reset() { *m = AddRequest{} }
*x = NewRequest{} func (m *AddRequest) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*AddRequest) ProtoMessage() {}
mi := &file_proto_feeds_proto_msgTypes[2] func (*AddRequest) Descriptor() ([]byte, []int) {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) return fileDescriptor_dd517c38176c13bf, []int{2}
ms.StoreMessageInfo(mi)
}
} }
func (x *NewRequest) String() string { func (m *AddRequest) XXX_Unmarshal(b []byte) error {
return protoimpl.X.MessageStringOf(x) return xxx_messageInfo_AddRequest.Unmarshal(m, b)
}
func (m *AddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AddRequest.Marshal(b, m, deterministic)
}
func (m *AddRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_AddRequest.Merge(m, src)
}
func (m *AddRequest) XXX_Size() int {
return xxx_messageInfo_AddRequest.Size(m)
}
func (m *AddRequest) XXX_DiscardUnknown() {
xxx_messageInfo_AddRequest.DiscardUnknown(m)
} }
func (*NewRequest) ProtoMessage() {} var xxx_messageInfo_AddRequest proto.InternalMessageInfo
func (x *NewRequest) ProtoReflect() protoreflect.Message { func (m *AddRequest) GetName() string {
mi := &file_proto_feeds_proto_msgTypes[2] if m != nil {
if protoimpl.UnsafeEnabled && x != nil { return m.Name
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NewRequest.ProtoReflect.Descriptor instead.
func (*NewRequest) Descriptor() ([]byte, []int) {
return file_proto_feeds_proto_rawDescGZIP(), []int{2}
}
func (x *NewRequest) GetName() string {
if x != nil {
return x.Name
} }
return "" return ""
} }
func (x *NewRequest) GetUrl() string { func (m *AddRequest) GetUrl() string {
if x != nil { if m != nil {
return x.Url return m.Url
} }
return "" return ""
} }
type NewResponse struct { type AddResponse struct {
state protoimpl.MessageState XXX_NoUnkeyedLiteral struct{} `json:"-"`
sizeCache protoimpl.SizeCache XXX_unrecognized []byte `json:"-"`
unknownFields protoimpl.UnknownFields XXX_sizecache int32 `json:"-"`
} }
func (x *NewResponse) Reset() { func (m *AddResponse) Reset() { *m = AddResponse{} }
*x = NewResponse{} func (m *AddResponse) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*AddResponse) ProtoMessage() {}
mi := &file_proto_feeds_proto_msgTypes[3] func (*AddResponse) Descriptor() ([]byte, []int) {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) return fileDescriptor_dd517c38176c13bf, []int{3}
ms.StoreMessageInfo(mi)
}
} }
func (x *NewResponse) String() string { func (m *AddResponse) XXX_Unmarshal(b []byte) error {
return protoimpl.X.MessageStringOf(x) return xxx_messageInfo_AddResponse.Unmarshal(m, b)
}
func (m *AddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AddResponse.Marshal(b, m, deterministic)
}
func (m *AddResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_AddResponse.Merge(m, src)
}
func (m *AddResponse) XXX_Size() int {
return xxx_messageInfo_AddResponse.Size(m)
}
func (m *AddResponse) XXX_DiscardUnknown() {
xxx_messageInfo_AddResponse.DiscardUnknown(m)
} }
func (*NewResponse) ProtoMessage() {} var xxx_messageInfo_AddResponse proto.InternalMessageInfo
func (x *NewResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_feeds_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NewResponse.ProtoReflect.Descriptor instead.
func (*NewResponse) Descriptor() ([]byte, []int) {
return file_proto_feeds_proto_rawDescGZIP(), []int{3}
}
type EntriesRequest struct { type EntriesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// rss feed url // rss feed url
// eg. http://a16z.com/feed/ // eg. http://a16z.com/feed/
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (x *EntriesRequest) Reset() { func (m *EntriesRequest) Reset() { *m = EntriesRequest{} }
*x = EntriesRequest{} func (m *EntriesRequest) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*EntriesRequest) ProtoMessage() {}
mi := &file_proto_feeds_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EntriesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EntriesRequest) ProtoMessage() {}
func (x *EntriesRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_feeds_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EntriesRequest.ProtoReflect.Descriptor instead.
func (*EntriesRequest) Descriptor() ([]byte, []int) { func (*EntriesRequest) Descriptor() ([]byte, []int) {
return file_proto_feeds_proto_rawDescGZIP(), []int{4} return fileDescriptor_dd517c38176c13bf, []int{4}
} }
func (x *EntriesRequest) GetUrl() string { func (m *EntriesRequest) XXX_Unmarshal(b []byte) error {
if x != nil { return xxx_messageInfo_EntriesRequest.Unmarshal(m, b)
return x.Url }
func (m *EntriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EntriesRequest.Marshal(b, m, deterministic)
}
func (m *EntriesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_EntriesRequest.Merge(m, src)
}
func (m *EntriesRequest) XXX_Size() int {
return xxx_messageInfo_EntriesRequest.Size(m)
}
func (m *EntriesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_EntriesRequest.DiscardUnknown(m)
}
var xxx_messageInfo_EntriesRequest proto.InternalMessageInfo
func (m *EntriesRequest) GetUrl() string {
if m != nil {
return m.Url
} }
return "" return ""
} }
type EntriesResponse struct { type EntriesResponse struct {
state protoimpl.MessageState Entries []*Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
sizeCache protoimpl.SizeCache XXX_NoUnkeyedLiteral struct{} `json:"-"`
unknownFields protoimpl.UnknownFields XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Entries []*Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
} }
func (x *EntriesResponse) Reset() { func (m *EntriesResponse) Reset() { *m = EntriesResponse{} }
*x = EntriesResponse{} func (m *EntriesResponse) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*EntriesResponse) ProtoMessage() {}
mi := &file_proto_feeds_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EntriesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EntriesResponse) ProtoMessage() {}
func (x *EntriesResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_feeds_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EntriesResponse.ProtoReflect.Descriptor instead.
func (*EntriesResponse) Descriptor() ([]byte, []int) { func (*EntriesResponse) Descriptor() ([]byte, []int) {
return file_proto_feeds_proto_rawDescGZIP(), []int{5} return fileDescriptor_dd517c38176c13bf, []int{5}
} }
func (x *EntriesResponse) GetEntries() []*Entry { func (m *EntriesResponse) XXX_Unmarshal(b []byte) error {
if x != nil { return xxx_messageInfo_EntriesResponse.Unmarshal(m, b)
return x.Entries }
func (m *EntriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EntriesResponse.Marshal(b, m, deterministic)
}
func (m *EntriesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_EntriesResponse.Merge(m, src)
}
func (m *EntriesResponse) XXX_Size() int {
return xxx_messageInfo_EntriesResponse.Size(m)
}
func (m *EntriesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_EntriesResponse.DiscardUnknown(m)
}
var xxx_messageInfo_EntriesResponse proto.InternalMessageInfo
func (m *EntriesResponse) GetEntries() []*Entry {
if m != nil {
return m.Entries
} }
return nil return nil
} }
var File_proto_feeds_proto protoreflect.FileDescriptor type ListRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
var file_proto_feeds_proto_rawDesc = []byte{ XXX_unrecognized []byte `json:"-"`
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x70, 0x72, XXX_sizecache int32 `json:"-"`
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x66, 0x65, 0x65, 0x64, 0x73, 0x22, 0x2c, 0x0a, 0x04, 0x46, 0x65,
0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x85, 0x01, 0x0a, 0x05, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72,
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05,
0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74,
0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65,
0x22, 0x32, 0x0a, 0x0a, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x72, 0x6c, 0x22, 0x0d, 0x0a, 0x0b, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x22, 0x0a, 0x0e, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x39, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x72, 0x69,
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x65, 0x6e,
0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x66, 0x65,
0x65, 0x64, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69,
0x65, 0x73, 0x32, 0x73, 0x0a, 0x05, 0x46, 0x65, 0x65, 0x64, 0x73, 0x12, 0x2e, 0x0a, 0x03, 0x4e,
0x65, 0x77, 0x12, 0x11, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x4e, 0x65, 0x77, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x4e, 0x65,
0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x07, 0x45,
0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x45,
0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x3b, 0x66, 0x65, 0x65, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( func (m *ListRequest) Reset() { *m = ListRequest{} }
file_proto_feeds_proto_rawDescOnce sync.Once func (m *ListRequest) String() string { return proto.CompactTextString(m) }
file_proto_feeds_proto_rawDescData = file_proto_feeds_proto_rawDesc func (*ListRequest) ProtoMessage() {}
) func (*ListRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_dd517c38176c13bf, []int{6}
func file_proto_feeds_proto_rawDescGZIP() []byte {
file_proto_feeds_proto_rawDescOnce.Do(func() {
file_proto_feeds_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_feeds_proto_rawDescData)
})
return file_proto_feeds_proto_rawDescData
} }
var file_proto_feeds_proto_msgTypes = make([]protoimpl.MessageInfo, 6) func (m *ListRequest) XXX_Unmarshal(b []byte) error {
var file_proto_feeds_proto_goTypes = []interface{}{ return xxx_messageInfo_ListRequest.Unmarshal(m, b)
(*Feed)(nil), // 0: feeds.Feed
(*Entry)(nil), // 1: feeds.Entry
(*NewRequest)(nil), // 2: feeds.NewRequest
(*NewResponse)(nil), // 3: feeds.NewResponse
(*EntriesRequest)(nil), // 4: feeds.EntriesRequest
(*EntriesResponse)(nil), // 5: feeds.EntriesResponse
} }
var file_proto_feeds_proto_depIdxs = []int32{ func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
1, // 0: feeds.EntriesResponse.entries:type_name -> feeds.Entry return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic)
2, // 1: feeds.Feeds.New:input_type -> feeds.NewRequest }
4, // 2: feeds.Feeds.Entries:input_type -> feeds.EntriesRequest func (m *ListRequest) XXX_Merge(src proto.Message) {
3, // 3: feeds.Feeds.New:output_type -> feeds.NewResponse xxx_messageInfo_ListRequest.Merge(m, src)
5, // 4: feeds.Feeds.Entries:output_type -> feeds.EntriesResponse }
3, // [3:5] is the sub-list for method output_type func (m *ListRequest) XXX_Size() int {
1, // [1:3] is the sub-list for method input_type return xxx_messageInfo_ListRequest.Size(m)
1, // [1:1] is the sub-list for extension type_name }
1, // [1:1] is the sub-list for extension extendee func (m *ListRequest) XXX_DiscardUnknown() {
0, // [0:1] is the sub-list for field type_name xxx_messageInfo_ListRequest.DiscardUnknown(m)
} }
func init() { file_proto_feeds_proto_init() } var xxx_messageInfo_ListRequest proto.InternalMessageInfo
func file_proto_feeds_proto_init() {
if File_proto_feeds_proto != nil { type ListResponse struct {
return Feeds []*Feed `protobuf:"bytes,1,rep,name=feeds,proto3" json:"feeds,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListResponse) Reset() { *m = ListResponse{} }
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage() {}
func (*ListResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_dd517c38176c13bf, []int{7}
}
func (m *ListResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListResponse.Unmarshal(m, b)
}
func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic)
}
func (m *ListResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListResponse.Merge(m, src)
}
func (m *ListResponse) XXX_Size() int {
return xxx_messageInfo_ListResponse.Size(m)
}
func (m *ListResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListResponse proto.InternalMessageInfo
func (m *ListResponse) GetFeeds() []*Feed {
if m != nil {
return m.Feeds
} }
if !protoimpl.UnsafeEnabled { return nil
file_proto_feeds_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { }
switch v := v.(*Feed); i {
case 0: type RemoveRequest struct {
return &v.state // rss feed name
case 1: // eg. a16z
return &v.sizeCache Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
case 2: XXX_NoUnkeyedLiteral struct{} `json:"-"`
return &v.unknownFields XXX_unrecognized []byte `json:"-"`
default: XXX_sizecache int32 `json:"-"`
return nil }
}
} func (m *RemoveRequest) Reset() { *m = RemoveRequest{} }
file_proto_feeds_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { func (m *RemoveRequest) String() string { return proto.CompactTextString(m) }
switch v := v.(*Entry); i { func (*RemoveRequest) ProtoMessage() {}
case 0: func (*RemoveRequest) Descriptor() ([]byte, []int) {
return &v.state return fileDescriptor_dd517c38176c13bf, []int{8}
case 1: }
return &v.sizeCache
case 2: func (m *RemoveRequest) XXX_Unmarshal(b []byte) error {
return &v.unknownFields return xxx_messageInfo_RemoveRequest.Unmarshal(m, b)
default: }
return nil func (m *RemoveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
} return xxx_messageInfo_RemoveRequest.Marshal(b, m, deterministic)
} }
file_proto_feeds_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { func (m *RemoveRequest) XXX_Merge(src proto.Message) {
switch v := v.(*NewRequest); i { xxx_messageInfo_RemoveRequest.Merge(m, src)
case 0: }
return &v.state func (m *RemoveRequest) XXX_Size() int {
case 1: return xxx_messageInfo_RemoveRequest.Size(m)
return &v.sizeCache }
case 2: func (m *RemoveRequest) XXX_DiscardUnknown() {
return &v.unknownFields xxx_messageInfo_RemoveRequest.DiscardUnknown(m)
default: }
return nil
} var xxx_messageInfo_RemoveRequest proto.InternalMessageInfo
}
file_proto_feeds_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { func (m *RemoveRequest) GetName() string {
switch v := v.(*NewResponse); i { if m != nil {
case 0: return m.Name
return &v.state }
case 1: return ""
return &v.sizeCache }
case 2:
return &v.unknownFields type RemoveResponse struct {
default: XXX_NoUnkeyedLiteral struct{} `json:"-"`
return nil XXX_unrecognized []byte `json:"-"`
} XXX_sizecache int32 `json:"-"`
} }
file_proto_feeds_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EntriesRequest); i { func (m *RemoveResponse) Reset() { *m = RemoveResponse{} }
case 0: func (m *RemoveResponse) String() string { return proto.CompactTextString(m) }
return &v.state func (*RemoveResponse) ProtoMessage() {}
case 1: func (*RemoveResponse) Descriptor() ([]byte, []int) {
return &v.sizeCache return fileDescriptor_dd517c38176c13bf, []int{9}
case 2: }
return &v.unknownFields
default: func (m *RemoveResponse) XXX_Unmarshal(b []byte) error {
return nil return xxx_messageInfo_RemoveResponse.Unmarshal(m, b)
} }
} func (m *RemoveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
file_proto_feeds_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { return xxx_messageInfo_RemoveResponse.Marshal(b, m, deterministic)
switch v := v.(*EntriesResponse); i { }
case 0: func (m *RemoveResponse) XXX_Merge(src proto.Message) {
return &v.state xxx_messageInfo_RemoveResponse.Merge(m, src)
case 1: }
return &v.sizeCache func (m *RemoveResponse) XXX_Size() int {
case 2: return xxx_messageInfo_RemoveResponse.Size(m)
return &v.unknownFields }
default: func (m *RemoveResponse) XXX_DiscardUnknown() {
return nil xxx_messageInfo_RemoveResponse.DiscardUnknown(m)
} }
}
} var xxx_messageInfo_RemoveResponse proto.InternalMessageInfo
type x struct{}
out := protoimpl.TypeBuilder{ func init() {
File: protoimpl.DescBuilder{ proto.RegisterType((*Feed)(nil), "feeds.Feed")
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), proto.RegisterType((*Entry)(nil), "feeds.Entry")
RawDescriptor: file_proto_feeds_proto_rawDesc, proto.RegisterType((*AddRequest)(nil), "feeds.AddRequest")
NumEnums: 0, proto.RegisterType((*AddResponse)(nil), "feeds.AddResponse")
NumMessages: 6, proto.RegisterType((*EntriesRequest)(nil), "feeds.EntriesRequest")
NumExtensions: 0, proto.RegisterType((*EntriesResponse)(nil), "feeds.EntriesResponse")
NumServices: 1, proto.RegisterType((*ListRequest)(nil), "feeds.ListRequest")
}, proto.RegisterType((*ListResponse)(nil), "feeds.ListResponse")
GoTypes: file_proto_feeds_proto_goTypes, proto.RegisterType((*RemoveRequest)(nil), "feeds.RemoveRequest")
DependencyIndexes: file_proto_feeds_proto_depIdxs, proto.RegisterType((*RemoveResponse)(nil), "feeds.RemoveResponse")
MessageInfos: file_proto_feeds_proto_msgTypes, }
}.Build()
File_proto_feeds_proto = out.File func init() { proto.RegisterFile("proto/feeds.proto", fileDescriptor_dd517c38176c13bf) }
file_proto_feeds_proto_rawDesc = nil
file_proto_feeds_proto_goTypes = nil var fileDescriptor_dd517c38176c13bf = []byte{
file_proto_feeds_proto_depIdxs = nil // 363 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcb, 0x4e, 0x2a, 0x41,
0x10, 0xbd, 0xc3, 0x3c, 0xc8, 0xad, 0x01, 0x2e, 0xd4, 0x05, 0xd2, 0x99, 0x15, 0xb6, 0x89, 0x61,
0x61, 0x30, 0xe0, 0xc2, 0xa8, 0x2b, 0x4c, 0x74, 0xe5, 0x6a, 0x96, 0xee, 0xd0, 0x2e, 0x93, 0x49,
0x60, 0x06, 0xe9, 0xc6, 0xc4, 0x0f, 0xf0, 0x3b, 0xfd, 0x15, 0xd3, 0xaf, 0xe1, 0xb1, 0x30, 0xee,
0xea, 0x9c, 0xaa, 0x73, 0xba, 0xfa, 0x74, 0x43, 0x6f, 0xbd, 0xa9, 0x54, 0x75, 0xf1, 0x4a, 0x24,
0xe4, 0xc4, 0xd4, 0x18, 0x1b, 0xc0, 0xcf, 0x21, 0x7a, 0x20, 0x12, 0x88, 0x10, 0x95, 0x8b, 0x15,
0xb1, 0x60, 0x14, 0x8c, 0xff, 0xe6, 0xa6, 0xc6, 0x2e, 0x84, 0xdb, 0xcd, 0x92, 0x35, 0x0c, 0xa5,
0x4b, 0xfe, 0x19, 0x40, 0x7c, 0x5f, 0xaa, 0xcd, 0x07, 0x76, 0xa0, 0x51, 0x08, 0x37, 0xdd, 0x28,
0x04, 0x0e, 0x21, 0x11, 0xd5, 0x6a, 0x51, 0x94, 0x6e, 0xdc, 0x21, 0xef, 0x11, 0xd6, 0x1e, 0xd8,
0x87, 0x58, 0x15, 0x6a, 0x49, 0x2c, 0x32, 0x9c, 0x05, 0xc8, 0xa0, 0xf9, 0x52, 0x95, 0x8a, 0x4a,
0xc5, 0x62, 0xc3, 0x7b, 0xa8, 0x37, 0x13, 0x0b, 0x45, 0x2c, 0x19, 0x05, 0xe3, 0x30, 0x37, 0x35,
0x9f, 0x01, 0xcc, 0x85, 0xc8, 0xe9, 0x6d, 0x4b, 0x52, 0xfd, 0x72, 0xf7, 0x36, 0xa4, 0x46, 0x23,
0xd7, 0x55, 0x29, 0x89, 0x73, 0xe8, 0xe8, 0x9b, 0x14, 0x24, 0xbd, 0x8d, 0x93, 0x04, 0x3b, 0xc9,
0x35, 0xfc, 0xab, 0x67, 0xac, 0x0c, 0xcf, 0xa0, 0x49, 0x96, 0x62, 0xc1, 0x28, 0x1c, 0xa7, 0xb3,
0xd6, 0xc4, 0xa6, 0x6a, 0x62, 0xc9, 0x7d, 0x53, 0x9f, 0xf6, 0x58, 0x48, 0xe5, 0xbc, 0xf9, 0x14,
0x5a, 0x16, 0x3a, 0x9b, 0x13, 0xb0, 0xf9, 0x3b, 0x93, 0xd4, 0x99, 0xe8, 0xa7, 0xc8, 0xdd, 0xcb,
0x9c, 0x42, 0x3b, 0xa7, 0x55, 0xf5, 0x4e, 0x3f, 0x5c, 0x93, 0x77, 0xa1, 0xe3, 0x87, 0xac, 0xf3,
0xec, 0x2b, 0x80, 0x58, 0xdb, 0x48, 0x9c, 0x40, 0x38, 0x17, 0x02, 0x7b, 0xce, 0x7b, 0x17, 0x58,
0x86, 0xfb, 0x94, 0xcb, 0xe3, 0x0f, 0x5e, 0x41, 0x62, 0xbd, 0xb0, 0xef, 0xfa, 0x07, 0xe7, 0x67,
0x83, 0x23, 0xb6, 0x16, 0xde, 0x40, 0xd3, 0xc5, 0x84, 0x83, 0xbd, 0x34, 0x76, 0xd1, 0x66, 0xc3,
0x63, 0xba, 0xd6, 0x4e, 0x21, 0xd2, 0xc1, 0xa0, 0x5f, 0x69, 0x2f, 0xb4, 0xec, 0xff, 0x01, 0xe7,
0x25, 0x77, 0xed, 0xa7, 0xd4, 0x7c, 0xe1, 0x5b, 0xd3, 0x7d, 0x4e, 0x0c, 0xb8, 0xfc, 0x0e, 0x00,
0x00, 0xff, 0xff, 0x30, 0x85, 0x1a, 0xbb, 0xe4, 0x02, 0x00, 0x00,
} }

View File

@@ -42,8 +42,10 @@ func NewFeedsEndpoints() []*api.Endpoint {
// Client API for Feeds service // Client API for Feeds service
type FeedsService interface { type FeedsService interface {
New(ctx context.Context, in *NewRequest, opts ...client.CallOption) (*NewResponse, error) Add(ctx context.Context, in *AddRequest, opts ...client.CallOption) (*AddResponse, error)
Remove(ctx context.Context, in *RemoveRequest, opts ...client.CallOption) (*RemoveResponse, error)
Entries(ctx context.Context, in *EntriesRequest, opts ...client.CallOption) (*EntriesResponse, error) Entries(ctx context.Context, in *EntriesRequest, opts ...client.CallOption) (*EntriesResponse, error)
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
} }
type feedsService struct { type feedsService struct {
@@ -58,9 +60,19 @@ func NewFeedsService(name string, c client.Client) FeedsService {
} }
} }
func (c *feedsService) New(ctx context.Context, in *NewRequest, opts ...client.CallOption) (*NewResponse, error) { func (c *feedsService) Add(ctx context.Context, in *AddRequest, opts ...client.CallOption) (*AddResponse, error) {
req := c.c.NewRequest(c.name, "Feeds.New", in) req := c.c.NewRequest(c.name, "Feeds.Add", in)
out := new(NewResponse) out := new(AddResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *feedsService) Remove(ctx context.Context, in *RemoveRequest, opts ...client.CallOption) (*RemoveResponse, error) {
req := c.c.NewRequest(c.name, "Feeds.Remove", in)
out := new(RemoveResponse)
err := c.c.Call(ctx, req, out, opts...) err := c.c.Call(ctx, req, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
@@ -78,17 +90,31 @@ func (c *feedsService) Entries(ctx context.Context, in *EntriesRequest, opts ...
return out, nil return out, nil
} }
func (c *feedsService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) {
req := c.c.NewRequest(c.name, "Feeds.List", in)
out := new(ListResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Feeds service // Server API for Feeds service
type FeedsHandler interface { type FeedsHandler interface {
New(context.Context, *NewRequest, *NewResponse) error Add(context.Context, *AddRequest, *AddResponse) error
Remove(context.Context, *RemoveRequest, *RemoveResponse) error
Entries(context.Context, *EntriesRequest, *EntriesResponse) error Entries(context.Context, *EntriesRequest, *EntriesResponse) error
List(context.Context, *ListRequest, *ListResponse) error
} }
func RegisterFeedsHandler(s server.Server, hdlr FeedsHandler, opts ...server.HandlerOption) error { func RegisterFeedsHandler(s server.Server, hdlr FeedsHandler, opts ...server.HandlerOption) error {
type feeds interface { type feeds interface {
New(ctx context.Context, in *NewRequest, out *NewResponse) error Add(ctx context.Context, in *AddRequest, out *AddResponse) error
Remove(ctx context.Context, in *RemoveRequest, out *RemoveResponse) error
Entries(ctx context.Context, in *EntriesRequest, out *EntriesResponse) error Entries(ctx context.Context, in *EntriesRequest, out *EntriesResponse) error
List(ctx context.Context, in *ListRequest, out *ListResponse) error
} }
type Feeds struct { type Feeds struct {
feeds feeds
@@ -101,10 +127,18 @@ type feedsHandler struct {
FeedsHandler FeedsHandler
} }
func (h *feedsHandler) New(ctx context.Context, in *NewRequest, out *NewResponse) error { func (h *feedsHandler) Add(ctx context.Context, in *AddRequest, out *AddResponse) error {
return h.FeedsHandler.New(ctx, in, out) return h.FeedsHandler.Add(ctx, in, out)
}
func (h *feedsHandler) Remove(ctx context.Context, in *RemoveRequest, out *RemoveResponse) error {
return h.FeedsHandler.Remove(ctx, in, out)
} }
func (h *feedsHandler) Entries(ctx context.Context, in *EntriesRequest, out *EntriesResponse) error { func (h *feedsHandler) Entries(ctx context.Context, in *EntriesRequest, out *EntriesResponse) error {
return h.FeedsHandler.Entries(ctx, in, out) return h.FeedsHandler.Entries(ctx, in, out)
} }
func (h *feedsHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error {
return h.FeedsHandler.List(ctx, in, out)
}

View File

@@ -5,8 +5,10 @@ package feeds;
option go_package = "proto;feeds"; option go_package = "proto;feeds";
service Feeds { service Feeds {
rpc New(NewRequest) returns (NewResponse) {} rpc Add(AddRequest) returns (AddResponse) {}
rpc Remove(RemoveRequest) returns (RemoveResponse) {}
rpc Entries(EntriesRequest) returns (EntriesResponse) {} rpc Entries(EntriesRequest) returns (EntriesResponse) {}
rpc List(ListRequest) returns (ListResponse) {}
} }
message Feed { message Feed {
@@ -27,7 +29,7 @@ message Entry {
int64 date = 6; int64 date = 6;
} }
message NewRequest { message AddRequest {
// rss feed name // rss feed name
// eg. a16z // eg. a16z
string name = 1; string name = 1;
@@ -36,7 +38,7 @@ message NewRequest {
string url = 2; string url = 2;
} }
message NewResponse { message AddResponse {
} }
message EntriesRequest { message EntriesRequest {
@@ -47,4 +49,20 @@ message EntriesRequest {
message EntriesResponse { message EntriesResponse {
repeated Entry entries = 1; repeated Entry entries = 1;
} }
message ListRequest {}
message ListResponse {
repeated Feed feeds = 1;
}
message RemoveRequest {
// rss feed name
// eg. a16z
string name = 1;
}
message RemoveResponse {
}