rpc

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_index_miner_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 {
	Meta  *MetaIndex    `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	Chain *OnChainIndex `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"`
	// contains filtered or unexported fields
}

func (*Index) Descriptor deprecated

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

Deprecated: Use Index.ProtoReflect.Descriptor instead.

func (*Index) GetChain

func (x *Index) GetChain() *OnChainIndex

func (*Index) GetMeta

func (x *Index) GetMeta() *MetaIndex

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 Location

type Location struct {
	Country   string  `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"`
	Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
	Latitude  float64 `protobuf:"fixed64,3,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// contains filtered or unexported fields
}

func (*Location) Descriptor deprecated

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

Deprecated: Use Location.ProtoReflect.Descriptor instead.

func (*Location) GetCountry

func (x *Location) GetCountry() string

func (*Location) GetLatitude

func (x *Location) GetLatitude() float64

func (*Location) GetLongitude

func (x *Location) GetLongitude() float64

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) ProtoReflect

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

func (*Location) Reset

func (x *Location) Reset()

func (*Location) String

func (x *Location) String() string

type Meta

type Meta struct {
	LastUpdated int64     `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
	UserAgent   string    `protobuf:"bytes,2,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"`
	Location    *Location `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"`
	Online      bool      `protobuf:"varint,4,opt,name=online,proto3" json:"online,omitempty"`
	// contains filtered or unexported fields
}

func (*Meta) Descriptor deprecated

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

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetLastUpdated

func (x *Meta) GetLastUpdated() int64

func (*Meta) GetLocation

func (x *Meta) GetLocation() *Location

func (*Meta) GetOnline

func (x *Meta) GetOnline() bool

func (*Meta) GetUserAgent

func (x *Meta) GetUserAgent() string

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect

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

func (*Meta) Reset

func (x *Meta) Reset()

func (*Meta) String

func (x *Meta) String() string

type MetaIndex

type MetaIndex struct {
	Online  uint32           `protobuf:"varint,1,opt,name=online,proto3" json:"online,omitempty"`
	Offline uint32           `protobuf:"varint,2,opt,name=offline,proto3" json:"offline,omitempty"`
	Info    map[string]*Meta `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*MetaIndex) Descriptor deprecated

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

Deprecated: Use MetaIndex.ProtoReflect.Descriptor instead.

func (*MetaIndex) GetInfo

func (x *MetaIndex) GetInfo() map[string]*Meta

func (*MetaIndex) GetOffline

func (x *MetaIndex) GetOffline() uint32

func (*MetaIndex) GetOnline

func (x *MetaIndex) GetOnline() uint32

func (*MetaIndex) ProtoMessage

func (*MetaIndex) ProtoMessage()

func (*MetaIndex) ProtoReflect

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

func (*MetaIndex) Reset

func (x *MetaIndex) Reset()

func (*MetaIndex) String

func (x *MetaIndex) String() string

type OnChainData

type OnChainData struct {
	Power         uint64  `protobuf:"varint,1,opt,name=power,proto3" json:"power,omitempty"`
	RelativePower float32 `protobuf:"fixed32,2,opt,name=relative_power,json=relativePower,proto3" json:"relative_power,omitempty"`
	SectorSize    uint64  `protobuf:"varint,3,opt,name=sector_size,json=sectorSize,proto3" json:"sector_size,omitempty"`
	ActiveDeals   uint64  `protobuf:"varint,4,opt,name=active_deals,json=activeDeals,proto3" json:"active_deals,omitempty"`
	// contains filtered or unexported fields
}

func (*OnChainData) Descriptor deprecated

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

Deprecated: Use OnChainData.ProtoReflect.Descriptor instead.

func (*OnChainData) GetActiveDeals

func (x *OnChainData) GetActiveDeals() uint64

func (*OnChainData) GetPower

func (x *OnChainData) GetPower() uint64

func (*OnChainData) GetRelativePower

func (x *OnChainData) GetRelativePower() float32

func (*OnChainData) GetSectorSize

func (x *OnChainData) GetSectorSize() uint64

func (*OnChainData) ProtoMessage

func (*OnChainData) ProtoMessage()

func (*OnChainData) ProtoReflect

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

func (*OnChainData) Reset

func (x *OnChainData) Reset()

func (*OnChainData) String

func (x *OnChainData) String() string

type OnChainIndex

type OnChainIndex struct {
	LastUpdated int64                   `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
	Miners      map[string]*OnChainData `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*OnChainIndex) Descriptor deprecated

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

Deprecated: Use OnChainIndex.ProtoReflect.Descriptor instead.

func (*OnChainIndex) GetLastUpdated

func (x *OnChainIndex) GetLastUpdated() int64

func (*OnChainIndex) GetMiners

func (x *OnChainIndex) GetMiners() map[string]*OnChainData

func (*OnChainIndex) ProtoMessage

func (*OnChainIndex) ProtoMessage()

func (*OnChainIndex) ProtoReflect

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

func (*OnChainIndex) Reset

func (x *OnChainIndex) Reset()

func (*OnChainIndex) String

func (x *OnChainIndex) String() string

type RPC

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

RPC implements the gprc service.

func New

func New(mi miner.Module) *RPC

New creates a new rpc service.

func (*RPC) Get

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

Get calls miner index Get.

type RPCServiceClient

type RPCServiceClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, 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)
}

RPCServiceServer is the server API for RPCService service.

type UnimplementedRPCServiceServer

type UnimplementedRPCServiceServer struct {
}

UnimplementedRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServiceServer) Get

Jump to

Keyboard shortcuts

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