Documentation
¶
Overview ¶
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterOracleHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterOracleHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OracleClient) error
- func RegisterOracleHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterOracleHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OracleServer) error
- func RegisterOracleServer(s grpc1.Server, srv OracleServer)
- type OracleClient
- type OracleServer
- type OracleService
- type QueryPricesRequest
- func (*QueryPricesRequest) Descriptor() ([]byte, []int)
- func (m *QueryPricesRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryPricesRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryPricesRequest) ProtoMessage()
- func (m *QueryPricesRequest) Reset()
- func (m *QueryPricesRequest) Size() (n int)
- func (m *QueryPricesRequest) String() string
- func (m *QueryPricesRequest) Unmarshal(dAtA []byte) error
- func (m *QueryPricesRequest) XXX_DiscardUnknown()
- func (m *QueryPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryPricesRequest) XXX_Merge(src proto.Message)
- func (m *QueryPricesRequest) XXX_Size() int
- func (m *QueryPricesRequest) XXX_Unmarshal(b []byte) error
- type QueryPricesResponse
- func (*QueryPricesResponse) Descriptor() ([]byte, []int)
- func (m *QueryPricesResponse) GetPrices() map[string]string
- func (m *QueryPricesResponse) GetTimestamp() time.Time
- func (m *QueryPricesResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryPricesResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryPricesResponse) ProtoMessage()
- func (m *QueryPricesResponse) Reset()
- func (m *QueryPricesResponse) Size() (n int)
- func (m *QueryPricesResponse) String() string
- func (m *QueryPricesResponse) Unmarshal(dAtA []byte) error
- func (m *QueryPricesResponse) XXX_DiscardUnknown()
- func (m *QueryPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryPricesResponse) XXX_Merge(src proto.Message)
- func (m *QueryPricesResponse) XXX_Size() int
- func (m *QueryPricesResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedOracleServer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterOracleHandler ¶
RegisterOracleHandler registers the http handlers for service Oracle to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterOracleHandlerClient ¶
func RegisterOracleHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OracleClient) error
RegisterOracleHandlerClient registers the http handlers for service Oracle to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OracleClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OracleClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OracleClient" to call the correct interceptors.
func RegisterOracleHandlerFromEndpoint ¶
func RegisterOracleHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterOracleHandlerFromEndpoint is same as RegisterOracleHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOracleHandlerServer ¶
func RegisterOracleHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OracleServer) error
RegisterOracleHandlerServer registers the http handlers for service Oracle to "mux". UnaryRPC :call OracleServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOracleHandlerFromEndpoint instead.
func RegisterOracleServer ¶
func RegisterOracleServer(s grpc1.Server, srv OracleServer)
Types ¶
type OracleClient ¶
type OracleClient interface {
// Prices defines a method for fetching the latest prices.
Prices(ctx context.Context, in *QueryPricesRequest, opts ...grpc.CallOption) (*QueryPricesResponse, error)
}
OracleClient is the client API for Oracle service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewOracleClient ¶
func NewOracleClient(cc grpc1.ClientConn) OracleClient
type OracleServer ¶
type OracleServer interface {
// Prices defines a method for fetching the latest prices.
Prices(context.Context, *QueryPricesRequest) (*QueryPricesResponse, error)
}
OracleServer is the server API for Oracle service.
type OracleService ¶
type OracleService interface {
OracleServer
Start(context.Context) error
Stop(context.Context) error
}
OracleService defines the service all clients must implement.
type QueryPricesRequest ¶
type QueryPricesRequest struct {
}
QueryPricesRequest defines the request type for the the Prices method.
func (*QueryPricesRequest) Descriptor ¶
func (*QueryPricesRequest) Descriptor() ([]byte, []int)
func (*QueryPricesRequest) Marshal ¶
func (m *QueryPricesRequest) Marshal() (dAtA []byte, err error)
func (*QueryPricesRequest) MarshalTo ¶
func (m *QueryPricesRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryPricesRequest) MarshalToSizedBuffer ¶
func (m *QueryPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryPricesRequest) ProtoMessage ¶
func (*QueryPricesRequest) ProtoMessage()
func (*QueryPricesRequest) Reset ¶
func (m *QueryPricesRequest) Reset()
func (*QueryPricesRequest) Size ¶
func (m *QueryPricesRequest) Size() (n int)
func (*QueryPricesRequest) String ¶
func (m *QueryPricesRequest) String() string
func (*QueryPricesRequest) Unmarshal ¶
func (m *QueryPricesRequest) Unmarshal(dAtA []byte) error
func (*QueryPricesRequest) XXX_DiscardUnknown ¶
func (m *QueryPricesRequest) XXX_DiscardUnknown()
func (*QueryPricesRequest) XXX_Marshal ¶
func (m *QueryPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryPricesRequest) XXX_Merge ¶
func (m *QueryPricesRequest) XXX_Merge(src proto.Message)
func (*QueryPricesRequest) XXX_Size ¶
func (m *QueryPricesRequest) XXX_Size() int
func (*QueryPricesRequest) XXX_Unmarshal ¶
func (m *QueryPricesRequest) XXX_Unmarshal(b []byte) error
type QueryPricesResponse ¶
type QueryPricesResponse struct {
// prices defines the list of prices.
Prices map[string]string `` /* 143-byte string literal not displayed */
Timestamp time.Time `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
}
QueryPricesResponse defines the response type for the Prices method.
func (*QueryPricesResponse) Descriptor ¶
func (*QueryPricesResponse) Descriptor() ([]byte, []int)
func (*QueryPricesResponse) GetPrices ¶
func (m *QueryPricesResponse) GetPrices() map[string]string
func (*QueryPricesResponse) GetTimestamp ¶
func (m *QueryPricesResponse) GetTimestamp() time.Time
func (*QueryPricesResponse) Marshal ¶
func (m *QueryPricesResponse) Marshal() (dAtA []byte, err error)
func (*QueryPricesResponse) MarshalTo ¶
func (m *QueryPricesResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryPricesResponse) MarshalToSizedBuffer ¶
func (m *QueryPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryPricesResponse) ProtoMessage ¶
func (*QueryPricesResponse) ProtoMessage()
func (*QueryPricesResponse) Reset ¶
func (m *QueryPricesResponse) Reset()
func (*QueryPricesResponse) Size ¶
func (m *QueryPricesResponse) Size() (n int)
func (*QueryPricesResponse) String ¶
func (m *QueryPricesResponse) String() string
func (*QueryPricesResponse) Unmarshal ¶
func (m *QueryPricesResponse) Unmarshal(dAtA []byte) error
func (*QueryPricesResponse) XXX_DiscardUnknown ¶
func (m *QueryPricesResponse) XXX_DiscardUnknown()
func (*QueryPricesResponse) XXX_Marshal ¶
func (m *QueryPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryPricesResponse) XXX_Merge ¶
func (m *QueryPricesResponse) XXX_Merge(src proto.Message)
func (*QueryPricesResponse) XXX_Size ¶
func (m *QueryPricesResponse) XXX_Size() int
func (*QueryPricesResponse) XXX_Unmarshal ¶
func (m *QueryPricesResponse) XXX_Unmarshal(b []byte) error
type UnimplementedOracleServer ¶
type UnimplementedOracleServer struct {
}
UnimplementedOracleServer can be embedded to have forward compatible implementations.
func (*UnimplementedOracleServer) Prices ¶
func (*UnimplementedOracleServer) Prices(ctx context.Context, req *QueryPricesRequest) (*QueryPricesResponse, error)