Documentation ¶
Index ¶
- Variables
- func RegisterRepoServer(s grpc.ServiceRegistrar, srv RepoServer)
- 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 QuoteRequest
- func (*QuoteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QuoteRequest) GetCode() string
- func (x *QuoteRequest) GetDate() string
- func (x *QuoteRequest) GetLimit() int64
- func (x *QuoteRequest) GetMode() QuoteRequest_Mode
- func (*QuoteRequest) ProtoMessage()
- func (x *QuoteRequest) ProtoReflect() protoreflect.Message
- func (x *QuoteRequest) Reset()
- func (x *QuoteRequest) String() string
- type QuoteRequest_Mode
- func (QuoteRequest_Mode) Descriptor() protoreflect.EnumDescriptor
- func (x QuoteRequest_Mode) Enum() *QuoteRequest_Mode
- func (QuoteRequest_Mode) EnumDescriptor() ([]byte, []int)deprecated
- func (x QuoteRequest_Mode) Number() protoreflect.EnumNumber
- func (x QuoteRequest_Mode) String() string
- func (QuoteRequest_Mode) Type() protoreflect.EnumType
- type RepoClient
- type RepoServer
- type Repo_GetQuoteLatestClient
- type Repo_GetQuoteLatestServer
- type Repo_GetStockFullClient
- type Repo_GetStockFullServer
- type Stock
- type UnimplementedRepoServer
- type UnsafeRepoServer
Constants ¶
This section is empty.
Variables ¶
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.
var File_repo_proto protoreflect.FileDescriptor
var Repo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "repository.Repo", HandlerType: (*RepoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Build", Handler: _Repo_Build_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetStockFull", Handler: _Repo_GetStockFull_Handler, ServerStreams: true, }, { StreamName: "GetQuoteLatest", Handler: _Repo_GetQuoteLatest_Handler, ServerStreams: true, }, }, Metadata: "repo.proto", }
Repo_ServiceDesc is the grpc.ServiceDesc for Repo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRepoServer ¶
func RegisterRepoServer(s grpc.ServiceRegistrar, srv RepoServer)
Types ¶
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 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=repository.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) Descriptor() protoreflect.EnumDescriptor
func (QuoteRequest_Mode) Enum ¶
func (x QuoteRequest_Mode) Enum() *QuoteRequest_Mode
func (QuoteRequest_Mode) EnumDescriptor
deprecated
func (QuoteRequest_Mode) EnumDescriptor() ([]byte, []int)
Deprecated: Use QuoteRequest_Mode.Descriptor instead.
func (QuoteRequest_Mode) Number ¶
func (x QuoteRequest_Mode) Number() protoreflect.EnumNumber
func (QuoteRequest_Mode) String ¶
func (x QuoteRequest_Mode) String() string
func (QuoteRequest_Mode) Type ¶
func (QuoteRequest_Mode) Type() protoreflect.EnumType
type RepoClient ¶
type RepoClient interface { Build(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) GetStockFull(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Repo_GetStockFullClient, error) GetQuoteLatest(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (Repo_GetQuoteLatestClient, error) }
RepoClient is the client API for Repo 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 NewRepoClient ¶
func NewRepoClient(cc grpc.ClientConnInterface) RepoClient
type RepoServer ¶
type RepoServer interface { Build(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) GetStockFull(*emptypb.Empty, Repo_GetStockFullServer) error GetQuoteLatest(*QuoteRequest, Repo_GetQuoteLatestServer) error // contains filtered or unexported methods }
RepoServer is the server API for Repo service. All implementations must embed UnimplementedRepoServer for forward compatibility
type Repo_GetQuoteLatestClient ¶
type Repo_GetQuoteLatestClient interface { Recv() (*Quote, error) grpc.ClientStream }
type Repo_GetQuoteLatestServer ¶
type Repo_GetQuoteLatestServer interface { Send(*Quote) error grpc.ServerStream }
type Repo_GetStockFullClient ¶
type Repo_GetStockFullClient interface { Recv() (*Stock, error) grpc.ClientStream }
type Repo_GetStockFullServer ¶
type Repo_GetStockFullServer interface { Send(*Stock) error grpc.ServerStream }
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 UnimplementedRepoServer ¶
type UnimplementedRepoServer struct { }
UnimplementedRepoServer must be embedded to have forward compatible implementations.
func (UnimplementedRepoServer) Build ¶
func (UnimplementedRepoServer) Build(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
func (UnimplementedRepoServer) GetQuoteLatest ¶
func (UnimplementedRepoServer) GetQuoteLatest(*QuoteRequest, Repo_GetQuoteLatestServer) error
func (UnimplementedRepoServer) GetStockFull ¶
func (UnimplementedRepoServer) GetStockFull(*emptypb.Empty, Repo_GetStockFullServer) error
type UnsafeRepoServer ¶
type UnsafeRepoServer interface {
// contains filtered or unexported methods
}
UnsafeRepoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RepoServer will result in compilation errors.