Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDBServer(s grpc.ServiceRegistrar, srv DBServer)
- type DBClient
- type DBServer
- type EntriesRes
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)deprecated
- func (x *Entry) GetEntryId() int64
- func (x *Entry) GetPageId() string
- func (x *Entry) GetPageLink() string
- func (x *Entry) GetPageTitle() string
- func (*Entry) ProtoMessage()
- func (x *Entry) ProtoReflect() protoreflect.Message
- func (x *Entry) Reset()
- func (x *Entry) String() string
- type EntrySaveReq
- func (*EntrySaveReq) Descriptor() ([]byte, []int)deprecated
- func (x *EntrySaveReq) GetPageId() string
- func (x *EntrySaveReq) GetPageLink() string
- func (x *EntrySaveReq) GetPageTitle() string
- func (*EntrySaveReq) ProtoMessage()
- func (x *EntrySaveReq) ProtoReflect() protoreflect.Message
- func (x *EntrySaveReq) Reset()
- func (x *EntrySaveReq) String() string
- type EntrySaveRes
- type None
- type UnimplementedDBServer
- type UnsafeDBServer
Constants ¶
const ( DB_SaveEntry_FullMethodName = "/DB/SaveEntry" DB_GetEntries_FullMethodName = "/DB/GetEntries" )
Variables ¶
var DB_ServiceDesc = grpc.ServiceDesc{ ServiceName: "DB", HandlerType: (*DBServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SaveEntry", Handler: _DB_SaveEntry_Handler, }, { MethodName: "GetEntries", Handler: _DB_GetEntries_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "db.proto", }
DB_ServiceDesc is the grpc.ServiceDesc for DB service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_db_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDBServer ¶
func RegisterDBServer(s grpc.ServiceRegistrar, srv DBServer)
Types ¶
type DBClient ¶
type DBClient interface {
SaveEntry(ctx context.Context, in *EntrySaveReq, opts ...grpc.CallOption) (*EntrySaveRes, error)
GetEntries(ctx context.Context, in *None, opts ...grpc.CallOption) (*EntriesRes, error)
}
DBClient is the client API for DB service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewDBClient ¶
func NewDBClient(cc grpc.ClientConnInterface) DBClient
type DBServer ¶
type DBServer interface {
SaveEntry(context.Context, *EntrySaveReq) (*EntrySaveRes, error)
GetEntries(context.Context, *None) (*EntriesRes, error)
// contains filtered or unexported methods
}
DBServer is the server API for DB service. All implementations must embed UnimplementedDBServer for forward compatibility
type EntriesRes ¶
type EntriesRes struct {
Entries []*Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
// contains filtered or unexported fields
}
func (*EntriesRes) Descriptor
deprecated
func (*EntriesRes) Descriptor() ([]byte, []int)
Deprecated: Use EntriesRes.ProtoReflect.Descriptor instead.
func (*EntriesRes) GetEntries ¶
func (x *EntriesRes) GetEntries() []*Entry
func (*EntriesRes) ProtoMessage ¶
func (*EntriesRes) ProtoMessage()
func (*EntriesRes) ProtoReflect ¶
func (x *EntriesRes) ProtoReflect() protoreflect.Message
func (*EntriesRes) Reset ¶
func (x *EntriesRes) Reset()
func (*EntriesRes) String ¶
func (x *EntriesRes) String() string
type Entry ¶
type Entry struct {
EntryId int64 `protobuf:"varint,1,opt,name=entryId,proto3" json:"entryId,omitempty"`
PageId string `protobuf:"bytes,2,opt,name=pageId,proto3" json:"pageId,omitempty"`
PageLink string `protobuf:"bytes,3,opt,name=pageLink,proto3" json:"pageLink,omitempty"`
PageTitle string `protobuf:"bytes,4,opt,name=pageTitle,proto3" json:"pageTitle,omitempty"`
// contains filtered or unexported fields
}
func (*Entry) Descriptor
deprecated
func (*Entry) GetEntryId ¶
func (*Entry) GetPageLink ¶
func (*Entry) GetPageTitle ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) ProtoReflect ¶
func (x *Entry) ProtoReflect() protoreflect.Message
type EntrySaveReq ¶
type EntrySaveReq struct {
PageId string `protobuf:"bytes,1,opt,name=pageId,proto3" json:"pageId,omitempty"`
PageTitle string `protobuf:"bytes,2,opt,name=pageTitle,proto3" json:"pageTitle,omitempty"`
PageLink string `protobuf:"bytes,3,opt,name=pageLink,proto3" json:"pageLink,omitempty"`
// contains filtered or unexported fields
}
func (*EntrySaveReq) Descriptor
deprecated
func (*EntrySaveReq) Descriptor() ([]byte, []int)
Deprecated: Use EntrySaveReq.ProtoReflect.Descriptor instead.
func (*EntrySaveReq) GetPageId ¶
func (x *EntrySaveReq) GetPageId() string
func (*EntrySaveReq) GetPageLink ¶
func (x *EntrySaveReq) GetPageLink() string
func (*EntrySaveReq) GetPageTitle ¶
func (x *EntrySaveReq) GetPageTitle() string
func (*EntrySaveReq) ProtoMessage ¶
func (*EntrySaveReq) ProtoMessage()
func (*EntrySaveReq) ProtoReflect ¶
func (x *EntrySaveReq) ProtoReflect() protoreflect.Message
func (*EntrySaveReq) Reset ¶
func (x *EntrySaveReq) Reset()
func (*EntrySaveReq) String ¶
func (x *EntrySaveReq) String() string
type EntrySaveRes ¶
type EntrySaveRes struct {
EntryId string `protobuf:"bytes,1,opt,name=entryId,proto3" json:"entryId,omitempty"`
// contains filtered or unexported fields
}
func (*EntrySaveRes) Descriptor
deprecated
func (*EntrySaveRes) Descriptor() ([]byte, []int)
Deprecated: Use EntrySaveRes.ProtoReflect.Descriptor instead.
func (*EntrySaveRes) GetEntryId ¶
func (x *EntrySaveRes) GetEntryId() string
func (*EntrySaveRes) ProtoMessage ¶
func (*EntrySaveRes) ProtoMessage()
func (*EntrySaveRes) ProtoReflect ¶
func (x *EntrySaveRes) ProtoReflect() protoreflect.Message
func (*EntrySaveRes) Reset ¶
func (x *EntrySaveRes) Reset()
func (*EntrySaveRes) String ¶
func (x *EntrySaveRes) String() string
type None ¶
type None struct {
// contains filtered or unexported fields
}
func (*None) Descriptor
deprecated
func (*None) ProtoMessage ¶
func (*None) ProtoMessage()
func (*None) ProtoReflect ¶
func (x *None) ProtoReflect() protoreflect.Message
type UnimplementedDBServer ¶
type UnimplementedDBServer struct {
}
UnimplementedDBServer must be embedded to have forward compatible implementations.
func (UnimplementedDBServer) GetEntries ¶
func (UnimplementedDBServer) GetEntries(context.Context, *None) (*EntriesRes, error)
func (UnimplementedDBServer) SaveEntry ¶
func (UnimplementedDBServer) SaveEntry(context.Context, *EntrySaveReq) (*EntrySaveRes, error)
type UnsafeDBServer ¶
type UnsafeDBServer interface {
// contains filtered or unexported methods
}
UnsafeDBServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DBServer will result in compilation errors.