Documentation ¶
Index ¶
- Variables
- func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
- type APIClient
- type APIServer
- type API_ListAllClient
- type API_ListAllServer
- type API_ListJobsClient
- type API_ListJobsServer
- type API_ListStoriesClient
- type API_ListStoriesServer
- type Item
- func (*Item) Descriptor() ([]byte, []int)deprecated
- func (x *Item) GetContent() string
- func (x *Item) GetCreatedAt() int64
- func (x *Item) GetCreatedBy() string
- func (x *Item) GetId() int32
- func (x *Item) GetScore() int32
- func (x *Item) GetTitle() string
- func (x *Item) GetType() string
- func (x *Item) GetUrl() string
- func (*Item) ProtoMessage()
- func (x *Item) ProtoReflect() protoreflect.Message
- func (x *Item) Reset()
- func (x *Item) String() string
- type UnimplementedAPIServer
- type UnsafeAPIServer
Constants ¶
This section is empty.
Variables ¶
var API_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.API", HandlerType: (*APIServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "ListAll", Handler: _API_ListAll_Handler, ServerStreams: true, }, { StreamName: "ListStories", Handler: _API_ListStories_Handler, ServerStreams: true, }, { StreamName: "ListJobs", Handler: _API_ListJobs_Handler, ServerStreams: true, }, }, Metadata: "api.proto", }
API_ServiceDesc is the grpc.ServiceDesc for API service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAPIServer ¶
func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
Types ¶
type APIClient ¶
type APIClient interface { ListAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (API_ListAllClient, error) ListStories(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (API_ListStoriesClient, error) ListJobs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (API_ListJobsClient, error) }
APIClient is the client API for API service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAPIClient ¶
func NewAPIClient(cc grpc.ClientConnInterface) APIClient
type APIServer ¶
type APIServer interface { ListAll(*emptypb.Empty, API_ListAllServer) error ListStories(*emptypb.Empty, API_ListStoriesServer) error ListJobs(*emptypb.Empty, API_ListJobsServer) error // contains filtered or unexported methods }
APIServer is the server API for API service. All implementations must embed UnimplementedAPIServer for forward compatibility
type API_ListAllClient ¶
type API_ListAllClient interface { Recv() (*Item, error) grpc.ClientStream }
type API_ListAllServer ¶
type API_ListAllServer interface { Send(*Item) error grpc.ServerStream }
type API_ListJobsClient ¶
type API_ListJobsClient interface { Recv() (*Item, error) grpc.ClientStream }
type API_ListJobsServer ¶
type API_ListJobsServer interface { Send(*Item) error grpc.ServerStream }
type API_ListStoriesClient ¶
type API_ListStoriesClient interface { Recv() (*Item, error) grpc.ClientStream }
type API_ListStoriesServer ¶
type API_ListStoriesServer interface { Send(*Item) error grpc.ServerStream }
type Item ¶
type Item struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` Score int32 `protobuf:"zigzag32,5,opt,name=score,proto3" json:"score,omitempty"` Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` CreatedBy string `protobuf:"bytes,8,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` // contains filtered or unexported fields }
func (*Item) Descriptor
deprecated
func (*Item) GetContent ¶
func (*Item) GetCreatedAt ¶
func (*Item) GetCreatedBy ¶
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type UnimplementedAPIServer ¶
type UnimplementedAPIServer struct { }
UnimplementedAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedAPIServer) ListAll ¶
func (UnimplementedAPIServer) ListAll(*emptypb.Empty, API_ListAllServer) error
func (UnimplementedAPIServer) ListJobs ¶
func (UnimplementedAPIServer) ListJobs(*emptypb.Empty, API_ListJobsServer) error
func (UnimplementedAPIServer) ListStories ¶
func (UnimplementedAPIServer) ListStories(*emptypb.Empty, API_ListStoriesServer) error
type UnsafeAPIServer ¶
type UnsafeAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIServer will result in compilation errors.