rpc

package
v0.1.1-pre.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_index_ask_rpc_rpc_proto protoreflect.FileDescriptor

Functions

func RegisterRPCServiceServer

func RegisterRPCServiceServer(s *grpc.Server, srv RPCServiceServer)

Types

type GetRequest

type GetRequest struct {
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Index *Index `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetIndex

func (x *GetResponse) GetIndex() *Index

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type Index

type Index struct {
	LastUpdated        int64                  `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
	StorageMedianPrice uint64                 `protobuf:"varint,2,opt,name=storage_median_price,json=storageMedianPrice,proto3" json:"storage_median_price,omitempty"`
	Storage            map[string]*StorageAsk `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Index) Descriptor deprecated

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

Deprecated: Use Index.ProtoReflect.Descriptor instead.

func (*Index) GetLastUpdated

func (x *Index) GetLastUpdated() int64

func (*Index) GetStorage

func (x *Index) GetStorage() map[string]*StorageAsk

func (*Index) GetStorageMedianPrice

func (x *Index) GetStorageMedianPrice() uint64

func (*Index) ProtoMessage

func (*Index) ProtoMessage()

func (*Index) ProtoReflect

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

func (*Index) Reset

func (x *Index) Reset()

func (*Index) String

func (x *Index) String() string

type Query

type Query struct {
	MaxPrice  uint64 `protobuf:"varint,1,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"`
	PieceSize uint64 `protobuf:"varint,2,opt,name=piece_size,json=pieceSize,proto3" json:"piece_size,omitempty"`
	Limit     int32  `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset    int32  `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*Query) Descriptor deprecated

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

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetLimit

func (x *Query) GetLimit() int32

func (*Query) GetMaxPrice

func (x *Query) GetMaxPrice() uint64

func (*Query) GetOffset

func (x *Query) GetOffset() int32

func (*Query) GetPieceSize

func (x *Query) GetPieceSize() uint64

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

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

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

type QueryRequest

type QueryRequest struct {
	Query *Query `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

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

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetQuery

func (x *QueryRequest) GetQuery() *Query

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) ProtoReflect

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

func (*QueryRequest) Reset

func (x *QueryRequest) Reset()

func (*QueryRequest) String

func (x *QueryRequest) String() string

type QueryResponse

type QueryResponse struct {
	Asks []*StorageAsk `protobuf:"bytes,1,rep,name=asks,proto3" json:"asks,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryResponse) Descriptor deprecated

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

Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.

func (*QueryResponse) GetAsks

func (x *QueryResponse) GetAsks() []*StorageAsk

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) ProtoReflect

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

func (*QueryResponse) Reset

func (x *QueryResponse) Reset()

func (*QueryResponse) String

func (x *QueryResponse) String() string

type RPC

type RPC struct {
	UnimplementedRPCServiceServer
	// contains filtered or unexported fields
}

RPC implements the gprc service.

func New

func New(ai ask.Module) *RPC

New creates a new rpc service.

func (*RPC) Get

func (s *RPC) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)

Get returns the current Ask Storage index.

func (*RPC) Query

func (s *RPC) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error)

Query executes a query on the current Ask Storage index.

type RPCServiceClient

type RPCServiceClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
}

RPCServiceClient is the client API for RPCService service.

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

func NewRPCServiceClient

func NewRPCServiceClient(cc grpc.ClientConnInterface) RPCServiceClient

type RPCServiceServer

type RPCServiceServer interface {
	Get(context.Context, *GetRequest) (*GetResponse, error)
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
}

RPCServiceServer is the server API for RPCService service.

type StorageAsk

type StorageAsk struct {
	Price        uint64 `protobuf:"varint,1,opt,name=price,proto3" json:"price,omitempty"`
	MinPieceSize uint64 `protobuf:"varint,2,opt,name=min_piece_size,json=minPieceSize,proto3" json:"min_piece_size,omitempty"`
	Miner        string `protobuf:"bytes,3,opt,name=miner,proto3" json:"miner,omitempty"`
	Timestamp    int64  `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Expiry       int64  `protobuf:"varint,5,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// contains filtered or unexported fields
}

func (*StorageAsk) Descriptor deprecated

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

Deprecated: Use StorageAsk.ProtoReflect.Descriptor instead.

func (*StorageAsk) GetExpiry

func (x *StorageAsk) GetExpiry() int64

func (*StorageAsk) GetMinPieceSize

func (x *StorageAsk) GetMinPieceSize() uint64

func (*StorageAsk) GetMiner

func (x *StorageAsk) GetMiner() string

func (*StorageAsk) GetPrice

func (x *StorageAsk) GetPrice() uint64

func (*StorageAsk) GetTimestamp

func (x *StorageAsk) GetTimestamp() int64

func (*StorageAsk) ProtoMessage

func (*StorageAsk) ProtoMessage()

func (*StorageAsk) ProtoReflect

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

func (*StorageAsk) Reset

func (x *StorageAsk) Reset()

func (*StorageAsk) String

func (x *StorageAsk) String() string

type UnimplementedRPCServiceServer

type UnimplementedRPCServiceServer struct {
}

UnimplementedRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServiceServer) Get

func (*UnimplementedRPCServiceServer) Query

Jump to

Keyboard shortcuts

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