pb

package
v0.0.0-...-27964f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Collector_CrawlMetadataAsync_FullMethodName = "/collector.Collector/CrawlMetadataAsync"
	Collector_CrawlMetadata_FullMethodName      = "/collector.Collector/CrawlMetadata"
	Collector_FetchMetadata_FullMethodName      = "/collector.Collector/FetchMetadata"
)

Variables

View Source
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)

View Source
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 (*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 (*StoreMetadataResponse_AffectedCount) GetStock

func (*StoreMetadataResponse_AffectedCount) ProtoMessage

func (*StoreMetadataResponse_AffectedCount) ProtoMessage()

func (*StoreMetadataResponse_AffectedCount) ProtoReflect

func (*StoreMetadataResponse_AffectedCount) Reset

func (*StoreMetadataResponse_AffectedCount) 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) CrawlMetadataAsync

func (UnimplementedCollectorServer) FetchMetadata

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL