update blog/posts and go mod

This commit is contained in:
Asim Aslam
2021-01-27 14:47:22 +00:00
parent fc7c6e0870
commit 87348d1908
8 changed files with 545 additions and 742 deletions

View File

@@ -1,211 +1,206 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.6.1
// source: proto/blog.proto
package blog
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
proto1 "github.com/micro/services/posts/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
math "math"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// 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 LatestRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (x *LatestRequest) Reset() {
*x = LatestRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_blog_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LatestRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LatestRequest) ProtoMessage() {}
func (x *LatestRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_blog_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 LatestRequest.ProtoReflect.Descriptor instead.
func (m *LatestRequest) Reset() { *m = LatestRequest{} }
func (m *LatestRequest) String() string { return proto.CompactTextString(m) }
func (*LatestRequest) ProtoMessage() {}
func (*LatestRequest) Descriptor() ([]byte, []int) {
return file_proto_blog_proto_rawDescGZIP(), []int{0}
return fileDescriptor_fc5203cdc85000bc, []int{0}
}
func (m *LatestRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LatestRequest.Unmarshal(m, b)
}
func (m *LatestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LatestRequest.Marshal(b, m, deterministic)
}
func (m *LatestRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_LatestRequest.Merge(m, src)
}
func (m *LatestRequest) XXX_Size() int {
return xxx_messageInfo_LatestRequest.Size(m)
}
func (m *LatestRequest) XXX_DiscardUnknown() {
xxx_messageInfo_LatestRequest.DiscardUnknown(m)
}
var xxx_messageInfo_LatestRequest proto.InternalMessageInfo
type LatestResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Latest *proto1.Post `protobuf:"bytes,1,opt,name=latest,proto3" json:"latest,omitempty"`
Latest *proto1.Post `protobuf:"bytes,1,opt,name=latest,proto3" json:"latest,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (x *LatestResponse) Reset() {
*x = LatestResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_blog_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LatestResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LatestResponse) ProtoMessage() {}
func (x *LatestResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_blog_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 LatestResponse.ProtoReflect.Descriptor instead.
func (m *LatestResponse) Reset() { *m = LatestResponse{} }
func (m *LatestResponse) String() string { return proto.CompactTextString(m) }
func (*LatestResponse) ProtoMessage() {}
func (*LatestResponse) Descriptor() ([]byte, []int) {
return file_proto_blog_proto_rawDescGZIP(), []int{1}
return fileDescriptor_fc5203cdc85000bc, []int{1}
}
func (x *LatestResponse) GetLatest() *proto1.Post {
if x != nil {
return x.Latest
func (m *LatestResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LatestResponse.Unmarshal(m, b)
}
func (m *LatestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LatestResponse.Marshal(b, m, deterministic)
}
func (m *LatestResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_LatestResponse.Merge(m, src)
}
func (m *LatestResponse) XXX_Size() int {
return xxx_messageInfo_LatestResponse.Size(m)
}
func (m *LatestResponse) XXX_DiscardUnknown() {
xxx_messageInfo_LatestResponse.DiscardUnknown(m)
}
var xxx_messageInfo_LatestResponse proto.InternalMessageInfo
func (m *LatestResponse) GetLatest() *proto1.Post {
if m != nil {
return m.Latest
}
return nil
}
var File_proto_blog_proto protoreflect.FileDescriptor
var file_proto_blog_proto_rawDesc = []byte{
0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x04, 0x62, 0x6c, 0x6f, 0x67, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x67, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x22, 0x35, 0x0a, 0x0e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x2e, 0x50, 0x6f, 0x73, 0x74,
0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x32, 0x3d, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x67,
0x12, 0x35, 0x0a, 0x06, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x62, 0x6c, 0x6f,
0x67, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x14, 0x2e, 0x62, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
type PostsRequest struct {
Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
var (
file_proto_blog_proto_rawDescOnce sync.Once
file_proto_blog_proto_rawDescData = file_proto_blog_proto_rawDesc
)
func file_proto_blog_proto_rawDescGZIP() []byte {
file_proto_blog_proto_rawDescOnce.Do(func() {
file_proto_blog_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_blog_proto_rawDescData)
})
return file_proto_blog_proto_rawDescData
func (m *PostsRequest) Reset() { *m = PostsRequest{} }
func (m *PostsRequest) String() string { return proto.CompactTextString(m) }
func (*PostsRequest) ProtoMessage() {}
func (*PostsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_fc5203cdc85000bc, []int{2}
}
var file_proto_blog_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_proto_blog_proto_goTypes = []interface{}{
(*LatestRequest)(nil), // 0: blog.LatestRequest
(*LatestResponse)(nil), // 1: blog.LatestResponse
(*proto1.Post)(nil), // 2: posts.Post
func (m *PostsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PostsRequest.Unmarshal(m, b)
}
var file_proto_blog_proto_depIdxs = []int32{
2, // 0: blog.LatestResponse.latest:type_name -> posts.Post
0, // 1: blog.Blog.Latest:input_type -> blog.LatestRequest
1, // 2: blog.Blog.Latest:output_type -> blog.LatestResponse
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
func (m *PostsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PostsRequest.Marshal(b, m, deterministic)
}
func (m *PostsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_PostsRequest.Merge(m, src)
}
func (m *PostsRequest) XXX_Size() int {
return xxx_messageInfo_PostsRequest.Size(m)
}
func (m *PostsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_PostsRequest.DiscardUnknown(m)
}
func init() { file_proto_blog_proto_init() }
func file_proto_blog_proto_init() {
if File_proto_blog_proto != nil {
return
var xxx_messageInfo_PostsRequest proto.InternalMessageInfo
func (m *PostsRequest) GetLimit() int64 {
if m != nil {
return m.Limit
}
if !protoimpl.UnsafeEnabled {
file_proto_blog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LatestRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_blog_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LatestResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_blog_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_blog_proto_goTypes,
DependencyIndexes: file_proto_blog_proto_depIdxs,
MessageInfos: file_proto_blog_proto_msgTypes,
}.Build()
File_proto_blog_proto = out.File
file_proto_blog_proto_rawDesc = nil
file_proto_blog_proto_goTypes = nil
file_proto_blog_proto_depIdxs = nil
return 0
}
func (m *PostsRequest) GetOffset() int64 {
if m != nil {
return m.Offset
}
return 0
}
type PostsResponse struct {
Posts []*proto1.Post `protobuf:"bytes,1,rep,name=posts,proto3" json:"posts,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PostsResponse) Reset() { *m = PostsResponse{} }
func (m *PostsResponse) String() string { return proto.CompactTextString(m) }
func (*PostsResponse) ProtoMessage() {}
func (*PostsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_fc5203cdc85000bc, []int{3}
}
func (m *PostsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PostsResponse.Unmarshal(m, b)
}
func (m *PostsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PostsResponse.Marshal(b, m, deterministic)
}
func (m *PostsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_PostsResponse.Merge(m, src)
}
func (m *PostsResponse) XXX_Size() int {
return xxx_messageInfo_PostsResponse.Size(m)
}
func (m *PostsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_PostsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_PostsResponse proto.InternalMessageInfo
func (m *PostsResponse) GetPosts() []*proto1.Post {
if m != nil {
return m.Posts
}
return nil
}
func init() {
proto.RegisterType((*LatestRequest)(nil), "blog.LatestRequest")
proto.RegisterType((*LatestResponse)(nil), "blog.LatestResponse")
proto.RegisterType((*PostsRequest)(nil), "blog.PostsRequest")
proto.RegisterType((*PostsResponse)(nil), "blog.PostsResponse")
}
func init() { proto.RegisterFile("proto/blog.proto", fileDescriptor_fc5203cdc85000bc) }
var fileDescriptor_fc5203cdc85000bc = []byte{
// 238 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x50, 0xb1, 0x4e, 0xc3, 0x30,
0x10, 0x25, 0xb4, 0xc9, 0x70, 0xa5, 0x80, 0xae, 0x15, 0x8a, 0x32, 0x15, 0xb3, 0x30, 0xc5, 0x22,
0xa8, 0x1b, 0x13, 0x33, 0x03, 0xca, 0x1f, 0x90, 0xc8, 0x0d, 0x96, 0x1c, 0x2e, 0xcd, 0xb9, 0x7c,
0x3f, 0xaa, 0xcf, 0x91, 0x48, 0xb7, 0xf7, 0xde, 0xf9, 0xbd, 0x77, 0x3e, 0xb8, 0x1f, 0x46, 0xf2,
0xa4, 0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