Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterStorageServer(s grpc.ServiceRegistrar, srv StorageServer)
- type GetQuoteLatestRequest
- func (*GetQuoteLatestRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetQuoteLatestRequest) GetCode() string
- func (x *GetQuoteLatestRequest) GetDate() string
- func (x *GetQuoteLatestRequest) GetKind() GetQuoteLatestRequest_Kind
- func (x *GetQuoteLatestRequest) GetLimit() int64
- func (*GetQuoteLatestRequest) ProtoMessage()
- func (x *GetQuoteLatestRequest) ProtoReflect() protoreflect.Message
- func (x *GetQuoteLatestRequest) Reset()
- func (x *GetQuoteLatestRequest) String() string
- type GetQuoteLatestRequest_Kind
- func (GetQuoteLatestRequest_Kind) Descriptor() protoreflect.EnumDescriptor
- func (x GetQuoteLatestRequest_Kind) Enum() *GetQuoteLatestRequest_Kind
- func (GetQuoteLatestRequest_Kind) EnumDescriptor() ([]byte, []int)deprecated
- func (x GetQuoteLatestRequest_Kind) Number() protoreflect.EnumNumber
- func (x GetQuoteLatestRequest_Kind) String() string
- func (GetQuoteLatestRequest_Kind) Type() protoreflect.EnumType
- type PushResponse
- type PushResponse_AffectedCount
- func (*PushResponse_AffectedCount) Descriptor() ([]byte, []int)deprecated
- func (x *PushResponse_AffectedCount) GetDays() int64
- func (x *PushResponse_AffectedCount) GetStocks() int64
- func (x *PushResponse_AffectedCount) GetWeeks() int64
- func (*PushResponse_AffectedCount) ProtoMessage()
- func (x *PushResponse_AffectedCount) ProtoReflect() protoreflect.Message
- func (x *PushResponse_AffectedCount) Reset()
- func (x *PushResponse_AffectedCount) String() string
- type Quote
- func (*Quote) Descriptor() ([]byte, []int)deprecated
- func (x *Quote) GetAccount() float64
- func (x *Quote) GetClose() float64
- func (x *Quote) GetCode() string
- func (x *Quote) GetDate() string
- func (x *Quote) GetHigh() float64
- func (x *Quote) GetLow() float64
- func (x *Quote) GetNumOfYear() int32
- func (x *Quote) GetOpen() float64
- func (x *Quote) GetVolume() uint64
- func (x *Quote) GetYesterdayClosed() float64
- func (*Quote) ProtoMessage()
- func (x *Quote) ProtoReflect() protoreflect.Message
- func (x *Quote) Reset()
- func (x *Quote) String() string
- type ShowResponse
- type ShowResponse_QueriedCount
- func (*ShowResponse_QueriedCount) Descriptor() ([]byte, []int)deprecated
- func (x *ShowResponse_QueriedCount) GetDays() int64
- func (x *ShowResponse_QueriedCount) GetWeeks() int64
- func (*ShowResponse_QueriedCount) ProtoMessage()
- func (x *ShowResponse_QueriedCount) ProtoReflect() protoreflect.Message
- func (x *ShowResponse_QueriedCount) Reset()
- func (x *ShowResponse_QueriedCount) String() string
- type Stock
- type StorageClient
- type StorageServer
- type Storage_GetQuoteLatestClient
- type Storage_GetQuoteLatestServer
- type Storage_GetStockAllClient
- type Storage_GetStockAllServer
- type Storage_PushMetadataClient
- type Storage_PushMetadataServer
- type UnimplementedStorageServer
- func (UnimplementedStorageServer) GetQuoteLatest(*GetQuoteLatestRequest, grpc.ServerStreamingServer[Quote]) error
- func (UnimplementedStorageServer) GetStockAll(*emptypb.Empty, grpc.ServerStreamingServer[Stock]) error
- func (UnimplementedStorageServer) GetStockOne(context.Context, *wrapperspb.StringValue) (*Stock, error)
- func (UnimplementedStorageServer) PushMetadata(grpc.ClientStreamingServer[entity.Metadata, PushResponse]) error
- func (UnimplementedStorageServer) StatsMetadata(context.Context, *wrapperspb.StringValue) (*ShowResponse, error)
- type UnsafeStorageServer
Constants ¶
const ( Storage_StatsMetadata_FullMethodName = "/storage.Storage/StatsMetadata" Storage_PushMetadata_FullMethodName = "/storage.Storage/PushMetadata" Storage_GetStockOne_FullMethodName = "/storage.Storage/GetStockOne" Storage_GetStockAll_FullMethodName = "/storage.Storage/GetStockAll" Storage_GetQuoteLatest_FullMethodName = "/storage.Storage/GetQuoteLatest" )
Variables ¶
var ( GetQuoteLatestRequest_Kind_name = map[int32]string{ 0: "Day", 1: "Week", } GetQuoteLatestRequest_Kind_value = map[string]int32{ "Day": 0, "Week": 1, } )
Enum value maps for GetQuoteLatestRequest_Kind.
var File_storage_proto protoreflect.FileDescriptor
var Storage_ServiceDesc = grpc.ServiceDesc{ ServiceName: "storage.Storage", HandlerType: (*StorageServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "StatsMetadata", Handler: _Storage_StatsMetadata_Handler, }, { MethodName: "GetStockOne", Handler: _Storage_GetStockOne_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "PushMetadata", Handler: _Storage_PushMetadata_Handler, ClientStreams: true, }, { StreamName: "GetStockAll", Handler: _Storage_GetStockAll_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 GetQuoteLatestRequest ¶
type GetQuoteLatestRequest 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"` Kind GetQuoteLatestRequest_Kind `protobuf:"varint,4,opt,name=kind,proto3,enum=storage.GetQuoteLatestRequest_Kind" json:"kind,omitempty"` // contains filtered or unexported fields }
func (*GetQuoteLatestRequest) Descriptor
deprecated
func (*GetQuoteLatestRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetQuoteLatestRequest.ProtoReflect.Descriptor instead.
func (*GetQuoteLatestRequest) GetCode ¶
func (x *GetQuoteLatestRequest) GetCode() string
func (*GetQuoteLatestRequest) GetDate ¶
func (x *GetQuoteLatestRequest) GetDate() string
func (*GetQuoteLatestRequest) GetKind ¶
func (x *GetQuoteLatestRequest) GetKind() GetQuoteLatestRequest_Kind
func (*GetQuoteLatestRequest) GetLimit ¶
func (x *GetQuoteLatestRequest) GetLimit() int64
func (*GetQuoteLatestRequest) ProtoMessage ¶
func (*GetQuoteLatestRequest) ProtoMessage()
func (*GetQuoteLatestRequest) ProtoReflect ¶
func (x *GetQuoteLatestRequest) ProtoReflect() protoreflect.Message
func (*GetQuoteLatestRequest) Reset ¶
func (x *GetQuoteLatestRequest) Reset()
func (*GetQuoteLatestRequest) String ¶
func (x *GetQuoteLatestRequest) String() string
type GetQuoteLatestRequest_Kind ¶
type GetQuoteLatestRequest_Kind int32
const ( GetQuoteLatestRequest_Day GetQuoteLatestRequest_Kind = 0 GetQuoteLatestRequest_Week GetQuoteLatestRequest_Kind = 1 )
func (GetQuoteLatestRequest_Kind) Descriptor ¶
func (GetQuoteLatestRequest_Kind) Descriptor() protoreflect.EnumDescriptor
func (GetQuoteLatestRequest_Kind) Enum ¶
func (x GetQuoteLatestRequest_Kind) Enum() *GetQuoteLatestRequest_Kind
func (GetQuoteLatestRequest_Kind) EnumDescriptor
deprecated
func (GetQuoteLatestRequest_Kind) EnumDescriptor() ([]byte, []int)
Deprecated: Use GetQuoteLatestRequest_Kind.Descriptor instead.
func (GetQuoteLatestRequest_Kind) Number ¶
func (x GetQuoteLatestRequest_Kind) Number() protoreflect.EnumNumber
func (GetQuoteLatestRequest_Kind) String ¶
func (x GetQuoteLatestRequest_Kind) String() string
func (GetQuoteLatestRequest_Kind) Type ¶
func (GetQuoteLatestRequest_Kind) Type() protoreflect.EnumType
type PushResponse ¶
type PushResponse struct { Affected *PushResponse_AffectedCount `protobuf:"bytes,1,opt,name=affected,proto3" json:"affected,omitempty"` // contains filtered or unexported fields }
func (*PushResponse) Descriptor
deprecated
func (*PushResponse) Descriptor() ([]byte, []int)
Deprecated: Use PushResponse.ProtoReflect.Descriptor instead.
func (*PushResponse) GetAffected ¶
func (x *PushResponse) GetAffected() *PushResponse_AffectedCount
func (*PushResponse) ProtoMessage ¶
func (*PushResponse) ProtoMessage()
func (*PushResponse) ProtoReflect ¶
func (x *PushResponse) ProtoReflect() protoreflect.Message
func (*PushResponse) Reset ¶
func (x *PushResponse) Reset()
func (*PushResponse) String ¶
func (x *PushResponse) String() string
type PushResponse_AffectedCount ¶
type PushResponse_AffectedCount struct { Stocks int64 `protobuf:"varint,1,opt,name=stocks,proto3" json:"stocks,omitempty"` Days int64 `protobuf:"varint,2,opt,name=days,proto3" json:"days,omitempty"` Weeks int64 `protobuf:"varint,3,opt,name=weeks,proto3" json:"weeks,omitempty"` // contains filtered or unexported fields }
func (*PushResponse_AffectedCount) Descriptor
deprecated
func (*PushResponse_AffectedCount) Descriptor() ([]byte, []int)
Deprecated: Use PushResponse_AffectedCount.ProtoReflect.Descriptor instead.
func (*PushResponse_AffectedCount) GetDays ¶
func (x *PushResponse_AffectedCount) GetDays() int64
func (*PushResponse_AffectedCount) GetStocks ¶
func (x *PushResponse_AffectedCount) GetStocks() int64
func (*PushResponse_AffectedCount) GetWeeks ¶
func (x *PushResponse_AffectedCount) GetWeeks() int64
func (*PushResponse_AffectedCount) ProtoMessage ¶
func (*PushResponse_AffectedCount) ProtoMessage()
func (*PushResponse_AffectedCount) ProtoReflect ¶
func (x *PushResponse_AffectedCount) ProtoReflect() protoreflect.Message
func (*PushResponse_AffectedCount) Reset ¶
func (x *PushResponse_AffectedCount) Reset()
func (*PushResponse_AffectedCount) String ¶
func (x *PushResponse_AffectedCount) 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) GetAccount ¶
func (*Quote) GetNumOfYear ¶
func (*Quote) GetYesterdayClosed ¶
func (*Quote) ProtoMessage ¶
func (*Quote) ProtoMessage()
func (*Quote) ProtoReflect ¶
func (x *Quote) ProtoReflect() protoreflect.Message
type ShowResponse ¶
type ShowResponse struct { Queried *ShowResponse_QueriedCount `protobuf:"bytes,1,opt,name=queried,proto3" json:"queried,omitempty"` // contains filtered or unexported fields }
func (*ShowResponse) Descriptor
deprecated
func (*ShowResponse) Descriptor() ([]byte, []int)
Deprecated: Use ShowResponse.ProtoReflect.Descriptor instead.
func (*ShowResponse) GetQueried ¶
func (x *ShowResponse) GetQueried() *ShowResponse_QueriedCount
func (*ShowResponse) ProtoMessage ¶
func (*ShowResponse) ProtoMessage()
func (*ShowResponse) ProtoReflect ¶
func (x *ShowResponse) ProtoReflect() protoreflect.Message
func (*ShowResponse) Reset ¶
func (x *ShowResponse) Reset()
func (*ShowResponse) String ¶
func (x *ShowResponse) String() string
type ShowResponse_QueriedCount ¶
type ShowResponse_QueriedCount struct { Days int64 `protobuf:"varint,2,opt,name=days,proto3" json:"days,omitempty"` Weeks int64 `protobuf:"varint,3,opt,name=weeks,proto3" json:"weeks,omitempty"` // contains filtered or unexported fields }
func (*ShowResponse_QueriedCount) Descriptor
deprecated
func (*ShowResponse_QueriedCount) Descriptor() ([]byte, []int)
Deprecated: Use ShowResponse_QueriedCount.ProtoReflect.Descriptor instead.
func (*ShowResponse_QueriedCount) GetDays ¶
func (x *ShowResponse_QueriedCount) GetDays() int64
func (*ShowResponse_QueriedCount) GetWeeks ¶
func (x *ShowResponse_QueriedCount) GetWeeks() int64
func (*ShowResponse_QueriedCount) ProtoMessage ¶
func (*ShowResponse_QueriedCount) ProtoMessage()
func (*ShowResponse_QueriedCount) ProtoReflect ¶
func (x *ShowResponse_QueriedCount) ProtoReflect() protoreflect.Message
func (*ShowResponse_QueriedCount) Reset ¶
func (x *ShowResponse_QueriedCount) Reset()
func (*ShowResponse_QueriedCount) String ¶
func (x *ShowResponse_QueriedCount) 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) GetSuspend ¶
func (*Stock) ProtoMessage ¶
func (*Stock) ProtoMessage()
func (*Stock) ProtoReflect ¶
func (x *Stock) ProtoReflect() protoreflect.Message
type StorageClient ¶
type StorageClient interface { StatsMetadata(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*ShowResponse, error) PushMetadata(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[entity.Metadata, PushResponse], error) GetStockOne(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*Stock, error) GetStockAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Stock], error) GetQuoteLatest(ctx context.Context, in *GetQuoteLatestRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Quote], 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 { StatsMetadata(context.Context, *wrapperspb.StringValue) (*ShowResponse, error) PushMetadata(grpc.ClientStreamingServer[entity.Metadata, PushResponse]) error GetStockOne(context.Context, *wrapperspb.StringValue) (*Stock, error) GetStockAll(*emptypb.Empty, grpc.ServerStreamingServer[Stock]) error GetQuoteLatest(*GetQuoteLatestRequest, grpc.ServerStreamingServer[Quote]) 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 = grpc.ServerStreamingClient[Quote]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Storage_GetQuoteLatestServer ¶
type Storage_GetQuoteLatestServer = grpc.ServerStreamingServer[Quote]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Storage_GetStockAllClient ¶
type Storage_GetStockAllClient = grpc.ServerStreamingClient[Stock]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Storage_GetStockAllServer ¶
type Storage_GetStockAllServer = grpc.ServerStreamingServer[Stock]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Storage_PushMetadataClient ¶
type Storage_PushMetadataClient = grpc.ClientStreamingClient[entity.Metadata, PushResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Storage_PushMetadataServer ¶
type Storage_PushMetadataServer = grpc.ClientStreamingServer[entity.Metadata, PushResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnimplementedStorageServer ¶
type UnimplementedStorageServer struct{}
UnimplementedStorageServer 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 (UnimplementedStorageServer) GetQuoteLatest ¶
func (UnimplementedStorageServer) GetQuoteLatest(*GetQuoteLatestRequest, grpc.ServerStreamingServer[Quote]) error
func (UnimplementedStorageServer) GetStockAll ¶
func (UnimplementedStorageServer) GetStockAll(*emptypb.Empty, grpc.ServerStreamingServer[Stock]) error
func (UnimplementedStorageServer) GetStockOne ¶
func (UnimplementedStorageServer) GetStockOne(context.Context, *wrapperspb.StringValue) (*Stock, error)
func (UnimplementedStorageServer) PushMetadata ¶
func (UnimplementedStorageServer) PushMetadata(grpc.ClientStreamingServer[entity.Metadata, PushResponse]) error
func (UnimplementedStorageServer) StatsMetadata ¶
func (UnimplementedStorageServer) StatsMetadata(context.Context, *wrapperspb.StringValue) (*ShowResponse, error)
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.