oracle

package
v0.0.0-...-8edd000 Latest Latest
Warning

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

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

Documentation

Overview

Package oracle is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const ModuleName = "oracle"

Variables

View Source
var (
	ParamsKey  = collections.NewPrefix(0)
	CounterKey = collections.NewPrefix(1)
	PricesKey  = collections.NewPrefix(2)
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrDuplicateAddress = errors.Register(ModuleName, 2, "duplicate address")

ErrDuplicateAddress error if there is a duplicate address

Functions

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the interfaces types with the interface registry.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer 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 RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Counter

type Counter struct {
	// count defines the count of the counter.
	Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// address defines the address that is associated with the count.
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
}

Counter defines a counter object. It is used only for genesis purposes. Collections does not need to use it.

func (*Counter) Descriptor

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

func (*Counter) GetAddress

func (m *Counter) GetAddress() string

func (*Counter) GetCount

func (m *Counter) GetCount() uint64

func (*Counter) Marshal

func (m *Counter) Marshal() (dAtA []byte, err error)

func (*Counter) MarshalTo

func (m *Counter) MarshalTo(dAtA []byte) (int, error)

func (*Counter) MarshalToSizedBuffer

func (m *Counter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Counter) ProtoMessage

func (*Counter) ProtoMessage()

func (*Counter) Reset

func (m *Counter) Reset()

func (*Counter) Size

func (m *Counter) Size() (n int)

func (*Counter) String

func (m *Counter) String() string

func (*Counter) Unmarshal

func (m *Counter) Unmarshal(dAtA []byte) error

func (*Counter) XXX_DiscardUnknown

func (m *Counter) XXX_DiscardUnknown()

func (*Counter) XXX_Marshal

func (m *Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Counter) XXX_Merge

func (m *Counter) XXX_Merge(src proto.Message)

func (*Counter) XXX_Size

func (m *Counter) XXX_Size() int

func (*Counter) XXX_Unmarshal

func (m *Counter) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	// counter defines the counter object.
	Counters []Counter `protobuf:"bytes,1,rep,name=counters,proto3" json:"counters"`
}

GenesisState is the state that must be provided at genesis.

func NewGenesisState

func NewGenesisState() *GenesisState

NewGenesisState creates a new genesis state with default values.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetCounters

func (m *GenesisState) GetCounters() []Counter

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) Validate

func (gs *GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// IncrementCounter increments the counter.
	IncrementCounter(ctx context.Context, in *MsgIncrementCounter, opts ...grpc.CallOption) (*MsgIncrementCounterResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgIncrementCounter

type MsgIncrementCounter struct {
	// sender is the message sender.
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
}

MsgIncrementCounter defines the Msg/IncrementCounter request type.

func (*MsgIncrementCounter) Descriptor

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

func (*MsgIncrementCounter) GetSender

func (m *MsgIncrementCounter) GetSender() string

func (*MsgIncrementCounter) Marshal

func (m *MsgIncrementCounter) Marshal() (dAtA []byte, err error)

func (*MsgIncrementCounter) MarshalTo

func (m *MsgIncrementCounter) MarshalTo(dAtA []byte) (int, error)

func (*MsgIncrementCounter) MarshalToSizedBuffer

func (m *MsgIncrementCounter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgIncrementCounter) ProtoMessage

func (*MsgIncrementCounter) ProtoMessage()

func (*MsgIncrementCounter) Reset

func (m *MsgIncrementCounter) Reset()

func (*MsgIncrementCounter) Size

func (m *MsgIncrementCounter) Size() (n int)

func (*MsgIncrementCounter) String

func (m *MsgIncrementCounter) String() string

func (*MsgIncrementCounter) Unmarshal

func (m *MsgIncrementCounter) Unmarshal(dAtA []byte) error

func (*MsgIncrementCounter) XXX_DiscardUnknown

func (m *MsgIncrementCounter) XXX_DiscardUnknown()

func (*MsgIncrementCounter) XXX_Marshal

func (m *MsgIncrementCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgIncrementCounter) XXX_Merge

func (m *MsgIncrementCounter) XXX_Merge(src proto.Message)

func (*MsgIncrementCounter) XXX_Size

func (m *MsgIncrementCounter) XXX_Size() int

func (*MsgIncrementCounter) XXX_Unmarshal

func (m *MsgIncrementCounter) XXX_Unmarshal(b []byte) error

type MsgIncrementCounterResponse

type MsgIncrementCounterResponse struct {
}

MsgIncrementCounterResponse defines the Msg/IncrementCounter response type.

func (*MsgIncrementCounterResponse) Descriptor

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

func (*MsgIncrementCounterResponse) Marshal

func (m *MsgIncrementCounterResponse) Marshal() (dAtA []byte, err error)

func (*MsgIncrementCounterResponse) MarshalTo

func (m *MsgIncrementCounterResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgIncrementCounterResponse) MarshalToSizedBuffer

func (m *MsgIncrementCounterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgIncrementCounterResponse) ProtoMessage

func (*MsgIncrementCounterResponse) ProtoMessage()

func (*MsgIncrementCounterResponse) Reset

func (m *MsgIncrementCounterResponse) Reset()

func (*MsgIncrementCounterResponse) Size

func (m *MsgIncrementCounterResponse) Size() (n int)

func (*MsgIncrementCounterResponse) String

func (m *MsgIncrementCounterResponse) String() string

func (*MsgIncrementCounterResponse) Unmarshal

func (m *MsgIncrementCounterResponse) Unmarshal(dAtA []byte) error

func (*MsgIncrementCounterResponse) XXX_DiscardUnknown

func (m *MsgIncrementCounterResponse) XXX_DiscardUnknown()

func (*MsgIncrementCounterResponse) XXX_Marshal

func (m *MsgIncrementCounterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgIncrementCounterResponse) XXX_Merge

func (m *MsgIncrementCounterResponse) XXX_Merge(src proto.Message)

func (*MsgIncrementCounterResponse) XXX_Size

func (m *MsgIncrementCounterResponse) XXX_Size() int

func (*MsgIncrementCounterResponse) XXX_Unmarshal

func (m *MsgIncrementCounterResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// IncrementCounter increments the counter.
	IncrementCounter(context.Context, *MsgIncrementCounter) (*MsgIncrementCounterResponse, error)
}

MsgServer is the server API for Msg service.

type Price

type Price struct {
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	Price  string `protobuf:"bytes,2,opt,name=price,proto3" json:"price,omitempty"`
}

Price represents the price of a specific symbol.

func (*Price) Descriptor

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

func (*Price) GetPrice

func (m *Price) GetPrice() string

func (*Price) GetSymbol

func (m *Price) GetSymbol() string

func (*Price) Marshal

func (m *Price) Marshal() (dAtA []byte, err error)

func (*Price) MarshalTo

func (m *Price) MarshalTo(dAtA []byte) (int, error)

func (*Price) MarshalToSizedBuffer

func (m *Price) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Price) ProtoMessage

func (*Price) ProtoMessage()

func (*Price) Reset

func (m *Price) Reset()

func (*Price) Size

func (m *Price) Size() (n int)

func (*Price) String

func (m *Price) String() string

func (*Price) Unmarshal

func (m *Price) Unmarshal(dAtA []byte) error

func (*Price) XXX_DiscardUnknown

func (m *Price) XXX_DiscardUnknown()

func (*Price) XXX_Marshal

func (m *Price) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Price) XXX_Merge

func (m *Price) XXX_Merge(src proto.Message)

func (*Price) XXX_Size

func (m *Price) XXX_Size() int

func (*Price) XXX_Unmarshal

func (m *Price) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Counter returns the current counter value.
	Counter(ctx context.Context, in *QueryCounterRequest, opts ...grpc.CallOption) (*QueryCounterResponse, error)
	// Prices returns the current prices.
	Prices(ctx context.Context, in *QueryPricesRequest, opts ...grpc.CallOption) (*QueryPricesResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryCounterRequest

type QueryCounterRequest struct {
	// address defines the address to query for the counter.
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

QueryCounterRequest is the request type for the Query/Counter RPC method.

func (*QueryCounterRequest) Descriptor

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

func (*QueryCounterRequest) GetAddress

func (m *QueryCounterRequest) GetAddress() string

func (*QueryCounterRequest) Marshal

func (m *QueryCounterRequest) Marshal() (dAtA []byte, err error)

func (*QueryCounterRequest) MarshalTo

func (m *QueryCounterRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryCounterRequest) MarshalToSizedBuffer

func (m *QueryCounterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryCounterRequest) ProtoMessage

func (*QueryCounterRequest) ProtoMessage()

func (*QueryCounterRequest) Reset

func (m *QueryCounterRequest) Reset()

func (*QueryCounterRequest) Size

func (m *QueryCounterRequest) Size() (n int)

func (*QueryCounterRequest) String

func (m *QueryCounterRequest) String() string

func (*QueryCounterRequest) Unmarshal

func (m *QueryCounterRequest) Unmarshal(dAtA []byte) error

func (*QueryCounterRequest) XXX_DiscardUnknown

func (m *QueryCounterRequest) XXX_DiscardUnknown()

func (*QueryCounterRequest) XXX_Marshal

func (m *QueryCounterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryCounterRequest) XXX_Merge

func (m *QueryCounterRequest) XXX_Merge(src proto.Message)

func (*QueryCounterRequest) XXX_Size

func (m *QueryCounterRequest) XXX_Size() int

func (*QueryCounterRequest) XXX_Unmarshal

func (m *QueryCounterRequest) XXX_Unmarshal(b []byte) error

type QueryCounterResponse

type QueryCounterResponse struct {
	// counter defines the current counter for the sender.
	Counter uint64 `protobuf:"varint,1,opt,name=counter,proto3" json:"counter,omitempty"`
}

QueryCounterResponse is the response type for the Query/Counter RPC method.

func (*QueryCounterResponse) Descriptor

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

func (*QueryCounterResponse) GetCounter

func (m *QueryCounterResponse) GetCounter() uint64

func (*QueryCounterResponse) Marshal

func (m *QueryCounterResponse) Marshal() (dAtA []byte, err error)

func (*QueryCounterResponse) MarshalTo

func (m *QueryCounterResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryCounterResponse) MarshalToSizedBuffer

func (m *QueryCounterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryCounterResponse) ProtoMessage

func (*QueryCounterResponse) ProtoMessage()

func (*QueryCounterResponse) Reset

func (m *QueryCounterResponse) Reset()

func (*QueryCounterResponse) Size

func (m *QueryCounterResponse) Size() (n int)

func (*QueryCounterResponse) String

func (m *QueryCounterResponse) String() string

func (*QueryCounterResponse) Unmarshal

func (m *QueryCounterResponse) Unmarshal(dAtA []byte) error

func (*QueryCounterResponse) XXX_DiscardUnknown

func (m *QueryCounterResponse) XXX_DiscardUnknown()

func (*QueryCounterResponse) XXX_Marshal

func (m *QueryCounterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryCounterResponse) XXX_Merge

func (m *QueryCounterResponse) XXX_Merge(src proto.Message)

func (*QueryCounterResponse) XXX_Size

func (m *QueryCounterResponse) XXX_Size() int

func (*QueryCounterResponse) XXX_Unmarshal

func (m *QueryCounterResponse) XXX_Unmarshal(b []byte) error

type QueryPricesRequest

type QueryPricesRequest struct {
}

QueryPricesRequest is the request type for the Query/Prices RPC 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 []*Price `protobuf:"bytes,1,rep,name=prices,proto3" json:"prices,omitempty"`
}

QueryPricesResponse is the response type for the Query/Prices RPC method.

func (*QueryPricesResponse) Descriptor

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

func (*QueryPricesResponse) GetPrices

func (m *QueryPricesResponse) GetPrices() []*Price

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 QueryServer

type QueryServer interface {
	// Counter returns the current counter value.
	Counter(context.Context, *QueryCounterRequest) (*QueryCounterResponse, error)
	// Prices returns the current prices.
	Prices(context.Context, *QueryPricesRequest) (*QueryPricesResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) IncrementCounter

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Counter

func (*UnimplementedQueryServer) Prices

Directories

Path Synopsis
api
module/v1
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
v1
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.

Jump to

Keyboard shortcuts

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