pb

package
v0.0.0-...-378a548 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Collector_CrawlMetadata_FullMethodName = "/collector.Collector/CrawlMetadata"
	Collector_StoreMetadata_FullMethodName = "/collector.Collector/StoreMetadata"
)

Variables

View Source
var Collector_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "collector.Collector",
	HandlerType: (*CollectorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CrawlMetadata",
			Handler:    _Collector_CrawlMetadata_Handler,
		},
		{
			MethodName: "StoreMetadata",
			Handler:    _Collector_StoreMetadata_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	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 last metadata with specify source(sina, net126)
	CrawlMetadata(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*CrawlCounter, error)
	// Store metadata to storage
	StoreMetadata(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*StoreCounter, 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 last metadata with specify source(sina, net126)
	CrawlMetadata(context.Context, *wrapperspb.StringValue) (*CrawlCounter, error)
	// Store metadata to storage
	StoreMetadata(context.Context, *wrapperspb.StringValue) (*StoreCounter, error)
	// contains filtered or unexported methods
}

CollectorServer is the server API for Collector service. All implementations must embed UnimplementedCollectorServer for forward compatibility

type CrawlCounter

type CrawlCounter 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 (*CrawlCounter) Descriptor deprecated

func (*CrawlCounter) Descriptor() ([]byte, []int)

Deprecated: Use CrawlCounter.ProtoReflect.Descriptor instead.

func (*CrawlCounter) GetIgnore

func (x *CrawlCounter) GetIgnore() int64

func (*CrawlCounter) GetTotal

func (x *CrawlCounter) GetTotal() int64

func (*CrawlCounter) ProtoMessage

func (*CrawlCounter) ProtoMessage()

func (*CrawlCounter) ProtoReflect

func (x *CrawlCounter) ProtoReflect() protoreflect.Message

func (*CrawlCounter) Reset

func (x *CrawlCounter) Reset()

func (*CrawlCounter) String

func (x *CrawlCounter) String() string

type StoreCounter

type StoreCounter struct {
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Stock int64 `protobuf:"varint,2,opt,name=stock,proto3" json:"stock,omitempty"`
	Day   int64 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"`
	Week  int64 `protobuf:"varint,4,opt,name=week,proto3" json:"week,omitempty"`
	// contains filtered or unexported fields
}

func (*StoreCounter) Descriptor deprecated

func (*StoreCounter) Descriptor() ([]byte, []int)

Deprecated: Use StoreCounter.ProtoReflect.Descriptor instead.

func (*StoreCounter) GetDay

func (x *StoreCounter) GetDay() int64

func (*StoreCounter) GetStock

func (x *StoreCounter) GetStock() int64

func (*StoreCounter) GetTotal

func (x *StoreCounter) GetTotal() int64

func (*StoreCounter) GetWeek

func (x *StoreCounter) GetWeek() int64

func (*StoreCounter) ProtoMessage

func (*StoreCounter) ProtoMessage()

func (*StoreCounter) ProtoReflect

func (x *StoreCounter) ProtoReflect() protoreflect.Message

func (*StoreCounter) Reset

func (x *StoreCounter) Reset()

func (*StoreCounter) String

func (x *StoreCounter) String() string

type UnimplementedCollectorServer

type UnimplementedCollectorServer struct {
}

UnimplementedCollectorServer must be embedded to have forward compatible implementations.

func (UnimplementedCollectorServer) CrawlMetadata

func (UnimplementedCollectorServer) StoreMetadata

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