Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer)
- type CollectorClient
- type CollectorServer
- type Collector_FetchMetadataClient
- type Collector_FetchMetadataServer
- type CrawlMetadataResponse
- func (*CrawlMetadataResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CrawlMetadataResponse) GetIgnore() int64
- func (x *CrawlMetadataResponse) GetTotal() int64
- func (*CrawlMetadataResponse) ProtoMessage()
- func (x *CrawlMetadataResponse) ProtoReflect() protoreflect.Message
- func (x *CrawlMetadataResponse) Reset()
- func (x *CrawlMetadataResponse) String() string
- type StoreMetadataResponse
- func (*StoreMetadataResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StoreMetadataResponse) GetAffected() *StoreMetadataResponse_AffectedCount
- func (*StoreMetadataResponse) ProtoMessage()
- func (x *StoreMetadataResponse) ProtoReflect() protoreflect.Message
- func (x *StoreMetadataResponse) Reset()
- func (x *StoreMetadataResponse) String() string
- type StoreMetadataResponse_AffectedCount
- func (*StoreMetadataResponse_AffectedCount) Descriptor() ([]byte, []int)deprecated
- func (x *StoreMetadataResponse_AffectedCount) GetQuote() int64
- func (x *StoreMetadataResponse_AffectedCount) GetStock() int64
- func (*StoreMetadataResponse_AffectedCount) ProtoMessage()
- func (x *StoreMetadataResponse_AffectedCount) ProtoReflect() protoreflect.Message
- func (x *StoreMetadataResponse_AffectedCount) Reset()
- func (x *StoreMetadataResponse_AffectedCount) String() string
- type UnimplementedCollectorServer
- func (UnimplementedCollectorServer) CrawlMetadata(context.Context, *wrapperspb.StringValue) (*CrawlMetadataResponse, error)
- func (UnimplementedCollectorServer) CrawlMetadataAsync(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
- func (UnimplementedCollectorServer) FetchMetadata(*wrapperspb.StringValue, grpc.ServerStreamingServer[entity.Metadata]) error
- type UnsafeCollectorServer
Constants ¶
const ( Collector_CrawlMetadataAsync_FullMethodName = "/collector.Collector/CrawlMetadataAsync" Collector_CrawlMetadata_FullMethodName = "/collector.Collector/CrawlMetadata" Collector_FetchMetadata_FullMethodName = "/collector.Collector/FetchMetadata" )
Variables ¶
var Collector_ServiceDesc = grpc.ServiceDesc{ ServiceName: "collector.Collector", HandlerType: (*CollectorServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CrawlMetadataAsync", Handler: _Collector_CrawlMetadataAsync_Handler, }, { MethodName: "CrawlMetadata", Handler: _Collector_CrawlMetadata_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "FetchMetadata", Handler: _Collector_FetchMetadata_Handler, ServerStreams: true, }, }, Metadata: "collector.proto", }
Collector_ServiceDesc is the grpc.ServiceDesc for Collector service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_collector_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCollectorServer ¶
func RegisterCollectorServer(s grpc.ServiceRegistrar, srv CollectorServer)
Types ¶
type CollectorClient ¶
type CollectorClient interface { // Crawl latest metadata from sina web(async) CrawlMetadataAsync(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) // Crawl latest metadata from sina web CrawlMetadata(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*CrawlMetadataResponse, error) // Fetch metadata from collector FetchMetadata(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (grpc.ServerStreamingClient[entity.Metadata], error) }
CollectorClient is the client API for Collector 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 NewCollectorClient ¶
func NewCollectorClient(cc grpc.ClientConnInterface) CollectorClient
type CollectorServer ¶
type CollectorServer interface { // Crawl latest metadata from sina web(async) CrawlMetadataAsync(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) // Crawl latest metadata from sina web CrawlMetadata(context.Context, *wrapperspb.StringValue) (*CrawlMetadataResponse, error) // Fetch metadata from collector FetchMetadata(*wrapperspb.StringValue, grpc.ServerStreamingServer[entity.Metadata]) error // contains filtered or unexported methods }
CollectorServer is the server API for Collector service. All implementations must embed UnimplementedCollectorServer for forward compatibility.
type Collector_FetchMetadataClient ¶
type Collector_FetchMetadataClient = grpc.ServerStreamingClient[entity.Metadata]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Collector_FetchMetadataServer ¶
type Collector_FetchMetadataServer = grpc.ServerStreamingServer[entity.Metadata]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type CrawlMetadataResponse ¶
type CrawlMetadataResponse struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Ignore int64 `protobuf:"varint,2,opt,name=ignore,proto3" json:"ignore,omitempty"` // contains filtered or unexported fields }
func (*CrawlMetadataResponse) Descriptor
deprecated
func (*CrawlMetadataResponse) Descriptor() ([]byte, []int)
Deprecated: Use CrawlMetadataResponse.ProtoReflect.Descriptor instead.
func (*CrawlMetadataResponse) GetIgnore ¶
func (x *CrawlMetadataResponse) GetIgnore() int64
func (*CrawlMetadataResponse) GetTotal ¶
func (x *CrawlMetadataResponse) GetTotal() int64
func (*CrawlMetadataResponse) ProtoMessage ¶
func (*CrawlMetadataResponse) ProtoMessage()
func (*CrawlMetadataResponse) ProtoReflect ¶
func (x *CrawlMetadataResponse) ProtoReflect() protoreflect.Message
func (*CrawlMetadataResponse) Reset ¶
func (x *CrawlMetadataResponse) Reset()
func (*CrawlMetadataResponse) String ¶
func (x *CrawlMetadataResponse) String() string
type StoreMetadataResponse ¶
type StoreMetadataResponse struct { Affected *StoreMetadataResponse_AffectedCount `protobuf:"bytes,1,opt,name=affected,proto3" json:"affected,omitempty"` // contains filtered or unexported fields }
func (*StoreMetadataResponse) Descriptor
deprecated
func (*StoreMetadataResponse) Descriptor() ([]byte, []int)
Deprecated: Use StoreMetadataResponse.ProtoReflect.Descriptor instead.
func (*StoreMetadataResponse) GetAffected ¶
func (x *StoreMetadataResponse) GetAffected() *StoreMetadataResponse_AffectedCount
func (*StoreMetadataResponse) ProtoMessage ¶
func (*StoreMetadataResponse) ProtoMessage()
func (*StoreMetadataResponse) ProtoReflect ¶
func (x *StoreMetadataResponse) ProtoReflect() protoreflect.Message
func (*StoreMetadataResponse) Reset ¶
func (x *StoreMetadataResponse) Reset()
func (*StoreMetadataResponse) String ¶
func (x *StoreMetadataResponse) String() string
type StoreMetadataResponse_AffectedCount ¶
type StoreMetadataResponse_AffectedCount struct { Stock int64 `protobuf:"varint,1,opt,name=stock,proto3" json:"stock,omitempty"` Quote int64 `protobuf:"varint,2,opt,name=quote,proto3" json:"quote,omitempty"` // contains filtered or unexported fields }
func (*StoreMetadataResponse_AffectedCount) Descriptor
deprecated
func (*StoreMetadataResponse_AffectedCount) Descriptor() ([]byte, []int)
Deprecated: Use StoreMetadataResponse_AffectedCount.ProtoReflect.Descriptor instead.
func (*StoreMetadataResponse_AffectedCount) GetQuote ¶
func (x *StoreMetadataResponse_AffectedCount) GetQuote() int64
func (*StoreMetadataResponse_AffectedCount) GetStock ¶
func (x *StoreMetadataResponse_AffectedCount) GetStock() int64
func (*StoreMetadataResponse_AffectedCount) ProtoMessage ¶
func (*StoreMetadataResponse_AffectedCount) ProtoMessage()
func (*StoreMetadataResponse_AffectedCount) ProtoReflect ¶
func (x *StoreMetadataResponse_AffectedCount) ProtoReflect() protoreflect.Message
func (*StoreMetadataResponse_AffectedCount) Reset ¶
func (x *StoreMetadataResponse_AffectedCount) Reset()
func (*StoreMetadataResponse_AffectedCount) String ¶
func (x *StoreMetadataResponse_AffectedCount) String() string
type UnimplementedCollectorServer ¶
type UnimplementedCollectorServer struct{}
UnimplementedCollectorServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedCollectorServer) CrawlMetadata ¶
func (UnimplementedCollectorServer) CrawlMetadata(context.Context, *wrapperspb.StringValue) (*CrawlMetadataResponse, error)
func (UnimplementedCollectorServer) CrawlMetadataAsync ¶
func (UnimplementedCollectorServer) CrawlMetadataAsync(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
func (UnimplementedCollectorServer) FetchMetadata ¶
func (UnimplementedCollectorServer) FetchMetadata(*wrapperspb.StringValue, grpc.ServerStreamingServer[entity.Metadata]) error
type UnsafeCollectorServer ¶
type UnsafeCollectorServer interface {
// contains filtered or unexported methods
}
UnsafeCollectorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CollectorServer will result in compilation errors.