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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Storage_PushMetadata_FullMethodName   = "/storage.Storage/PushMetadata"
	Storage_GetStockOne_FullMethodName    = "/storage.Storage/GetStockOne"
	Storage_GetStockFull_FullMethodName   = "/storage.Storage/GetStockFull"
	Storage_GetQuoteLatest_FullMethodName = "/storage.Storage/GetQuoteLatest"
)

Variables

View Source
var (
	QuoteRequest_Mode_name = map[int32]string{
		0: "Day",
		1: "Week",
	}
	QuoteRequest_Mode_value = map[string]int32{
		"Day":  0,
		"Week": 1,
	}
)

Enum value maps for QuoteRequest_Mode.

View Source
var File_storage_proto protoreflect.FileDescriptor
View Source
var Storage_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "storage.Storage",
	HandlerType: (*StorageServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetStockOne",
			Handler:    _Storage_GetStockOne_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "PushMetadata",
			Handler:       _Storage_PushMetadata_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "GetStockFull",
			Handler:       _Storage_GetStockFull_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "GetQuoteLatest",
			Handler:       _Storage_GetQuoteLatest_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "storage.proto",
}

Storage_ServiceDesc is the grpc.ServiceDesc for Storage service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterStorageServer

func RegisterStorageServer(s grpc.ServiceRegistrar, srv StorageServer)

Types

type Metadata

type Metadata struct {
	Source          string  `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
	Code            string  `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	Name            string  `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Open            float64 `protobuf:"fixed64,4,opt,name=open,proto3" json:"open,omitempty"`
	YesterdayClosed float64 `protobuf:"fixed64,5,opt,name=yesterday_closed,json=yesterdayClosed,proto3" json:"yesterday_closed,omitempty"`
	Latest          float64 `protobuf:"fixed64,6,opt,name=latest,proto3" json:"latest,omitempty"`
	High            float64 `protobuf:"fixed64,7,opt,name=high,proto3" json:"high,omitempty"`
	Low             float64 `protobuf:"fixed64,8,opt,name=low,proto3" json:"low,omitempty"`
	Volume          uint64  `protobuf:"varint,9,opt,name=volume,proto3" json:"volume,omitempty"`
	Account         float64 `protobuf:"fixed64,10,opt,name=account,proto3" json:"account,omitempty"`
	Date            string  `protobuf:"bytes,11,opt,name=date,proto3" json:"date,omitempty"`
	Time            string  `protobuf:"bytes,12,opt,name=time,proto3" json:"time,omitempty"`
	Suspend         string  `protobuf:"bytes,13,opt,name=suspend,proto3" json:"suspend,omitempty"`
	// contains filtered or unexported fields
}

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetAccount

func (x *Metadata) GetAccount() float64

func (*Metadata) GetCode

func (x *Metadata) GetCode() string

func (*Metadata) GetDate

func (x *Metadata) GetDate() string

func (*Metadata) GetHigh

func (x *Metadata) GetHigh() float64

func (*Metadata) GetLatest

func (x *Metadata) GetLatest() float64

func (*Metadata) GetLow

func (x *Metadata) GetLow() float64

func (*Metadata) GetName

func (x *Metadata) GetName() string

func (*Metadata) GetOpen

func (x *Metadata) GetOpen() float64

func (*Metadata) GetSource

func (x *Metadata) GetSource() string

func (*Metadata) GetSuspend

func (x *Metadata) GetSuspend() string

func (*Metadata) GetTime

func (x *Metadata) GetTime() string

func (*Metadata) GetVolume

func (x *Metadata) GetVolume() uint64

func (*Metadata) GetYesterdayClosed

func (x *Metadata) GetYesterdayClosed() float64

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

type Quote

type Quote struct {
	Code            string  `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Open            float64 `protobuf:"fixed64,2,opt,name=open,proto3" json:"open,omitempty"`
	Close           float64 `protobuf:"fixed64,3,opt,name=close,proto3" json:"close,omitempty"`
	High            float64 `protobuf:"fixed64,4,opt,name=high,proto3" json:"high,omitempty"`
	Low             float64 `protobuf:"fixed64,5,opt,name=low,proto3" json:"low,omitempty"`
	YesterdayClosed float64 `protobuf:"fixed64,6,opt,name=yesterday_closed,json=yesterdayClosed,proto3" json:"yesterday_closed,omitempty"`
	Volume          uint64  `protobuf:"varint,7,opt,name=volume,proto3" json:"volume,omitempty"`
	Account         float64 `protobuf:"fixed64,8,opt,name=account,proto3" json:"account,omitempty"`
	Date            string  `protobuf:"bytes,9,opt,name=date,proto3" json:"date,omitempty"`
	NumOfYear       int32   `protobuf:"varint,10,opt,name=num_of_year,json=numOfYear,proto3" json:"num_of_year,omitempty"`
	// contains filtered or unexported fields
}

func (*Quote) Descriptor deprecated

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

Deprecated: Use Quote.ProtoReflect.Descriptor instead.

func (*Quote) GetAccount

func (x *Quote) GetAccount() float64

func (*Quote) GetClose

func (x *Quote) GetClose() float64

func (*Quote) GetCode

func (x *Quote) GetCode() string

func (*Quote) GetDate

func (x *Quote) GetDate() string

func (*Quote) GetHigh

func (x *Quote) GetHigh() float64

func (*Quote) GetLow

func (x *Quote) GetLow() float64

func (*Quote) GetNumOfYear

func (x *Quote) GetNumOfYear() int32

func (*Quote) GetOpen

func (x *Quote) GetOpen() float64

func (*Quote) GetVolume

func (x *Quote) GetVolume() uint64

func (*Quote) GetYesterdayClosed

func (x *Quote) GetYesterdayClosed() float64

func (*Quote) ProtoMessage

func (*Quote) ProtoMessage()

func (*Quote) ProtoReflect

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

func (*Quote) Reset

func (x *Quote) Reset()

func (*Quote) String

func (x *Quote) String() string

type QuoteRequest

type QuoteRequest struct {
	Code  string            `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Date  string            `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"`
	Limit int64             `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	Mode  QuoteRequest_Mode `protobuf:"varint,4,opt,name=mode,proto3,enum=storage.QuoteRequest_Mode" json:"mode,omitempty"`
	// contains filtered or unexported fields
}

func (*QuoteRequest) Descriptor deprecated

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

Deprecated: Use QuoteRequest.ProtoReflect.Descriptor instead.

func (*QuoteRequest) GetCode

func (x *QuoteRequest) GetCode() string

func (*QuoteRequest) GetDate

func (x *QuoteRequest) GetDate() string

func (*QuoteRequest) GetLimit

func (x *QuoteRequest) GetLimit() int64

func (*QuoteRequest) GetMode

func (x *QuoteRequest) GetMode() QuoteRequest_Mode

func (*QuoteRequest) ProtoMessage

func (*QuoteRequest) ProtoMessage()

func (*QuoteRequest) ProtoReflect

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

func (*QuoteRequest) Reset

func (x *QuoteRequest) Reset()

func (*QuoteRequest) String

func (x *QuoteRequest) String() string

type QuoteRequest_Mode

type QuoteRequest_Mode int32
const (
	QuoteRequest_Day  QuoteRequest_Mode = 0
	QuoteRequest_Week QuoteRequest_Mode = 1
)

func (QuoteRequest_Mode) Descriptor

func (QuoteRequest_Mode) Enum

func (QuoteRequest_Mode) EnumDescriptor deprecated

func (QuoteRequest_Mode) EnumDescriptor() ([]byte, []int)

Deprecated: Use QuoteRequest_Mode.Descriptor instead.

func (QuoteRequest_Mode) Number

func (QuoteRequest_Mode) String

func (x QuoteRequest_Mode) String() string

func (QuoteRequest_Mode) Type

type Stats

type Stats struct {
	StockAffected     int64 `protobuf:"varint,1,opt,name=stock_affected,json=stockAffected,proto3" json:"stock_affected,omitempty"`
	QuoteDayAffected  int64 `protobuf:"varint,2,opt,name=quote_day_affected,json=quoteDayAffected,proto3" json:"quote_day_affected,omitempty"`
	QuoteWeekAffected int64 `protobuf:"varint,3,opt,name=quote_week_affected,json=quoteWeekAffected,proto3" json:"quote_week_affected,omitempty"`
	// contains filtered or unexported fields
}

func (*Stats) Descriptor deprecated

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

Deprecated: Use Stats.ProtoReflect.Descriptor instead.

func (*Stats) GetQuoteDayAffected

func (x *Stats) GetQuoteDayAffected() int64

func (*Stats) GetQuoteWeekAffected

func (x *Stats) GetQuoteWeekAffected() int64

func (*Stats) GetStockAffected

func (x *Stats) GetStockAffected() int64

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) ProtoReflect

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

func (*Stats) Reset

func (x *Stats) Reset()

func (*Stats) String

func (x *Stats) String() string

type Stock

type Stock struct {
	Code    string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Suspend string `protobuf:"bytes,3,opt,name=suspend,proto3" json:"suspend,omitempty"`
	// contains filtered or unexported fields
}

func (*Stock) Descriptor deprecated

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

Deprecated: Use Stock.ProtoReflect.Descriptor instead.

func (*Stock) GetCode

func (x *Stock) GetCode() string

func (*Stock) GetName

func (x *Stock) GetName() string

func (*Stock) GetSuspend

func (x *Stock) GetSuspend() string

func (*Stock) ProtoMessage

func (*Stock) ProtoMessage()

func (*Stock) ProtoReflect

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

func (*Stock) Reset

func (x *Stock) Reset()

func (*Stock) String

func (x *Stock) String() string

type StorageClient

type StorageClient interface {
	PushMetadata(ctx context.Context, opts ...grpc.CallOption) (Storage_PushMetadataClient, error)
	GetStockOne(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*Stock, error)
	GetStockFull(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Storage_GetStockFullClient, error)
	GetQuoteLatest(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (Storage_GetQuoteLatestClient, error)
}

StorageClient is the client API for Storage 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 NewStorageClient

func NewStorageClient(cc grpc.ClientConnInterface) StorageClient

type StorageServer

type StorageServer interface {
	PushMetadata(Storage_PushMetadataServer) error
	GetStockOne(context.Context, *wrapperspb.StringValue) (*Stock, error)
	GetStockFull(*emptypb.Empty, Storage_GetStockFullServer) error
	GetQuoteLatest(*QuoteRequest, Storage_GetQuoteLatestServer) error
	// contains filtered or unexported methods
}

StorageServer is the server API for Storage service. All implementations must embed UnimplementedStorageServer for forward compatibility

type Storage_GetQuoteLatestClient

type Storage_GetQuoteLatestClient interface {
	Recv() (*Quote, error)
	grpc.ClientStream
}

type Storage_GetQuoteLatestServer

type Storage_GetQuoteLatestServer interface {
	Send(*Quote) error
	grpc.ServerStream
}

type Storage_GetStockFullClient

type Storage_GetStockFullClient interface {
	Recv() (*Stock, error)
	grpc.ClientStream
}

type Storage_GetStockFullServer

type Storage_GetStockFullServer interface {
	Send(*Stock) error
	grpc.ServerStream
}

type Storage_PushMetadataClient

type Storage_PushMetadataClient interface {
	Send(*Metadata) error
	CloseAndRecv() (*Stats, error)
	grpc.ClientStream
}

type Storage_PushMetadataServer

type Storage_PushMetadataServer interface {
	SendAndClose(*Stats) error
	Recv() (*Metadata, error)
	grpc.ServerStream
}

type UnimplementedStorageServer

type UnimplementedStorageServer struct {
}

UnimplementedStorageServer must be embedded to have forward compatible implementations.

func (UnimplementedStorageServer) GetQuoteLatest

func (UnimplementedStorageServer) GetStockFull

func (UnimplementedStorageServer) GetStockOne

func (UnimplementedStorageServer) PushMetadata

type UnsafeStorageServer

type UnsafeStorageServer interface {
	// contains filtered or unexported methods
}

UnsafeStorageServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StorageServer will result in compilation errors.

Jump to

Keyboard shortcuts

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