rpc

package
v0.0.1-beta.3 Latest Latest
Warning

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

Go to latest
Published: May 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 RegisterRPCServer

func RegisterRPCServer(s *grpc.Server, srv RPCServer)

Types

type ChainIndex

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

func (*ChainIndex) Descriptor deprecated

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

Deprecated: Use ChainIndex.ProtoReflect.Descriptor instead.

func (*ChainIndex) GetLastUpdated

func (x *ChainIndex) GetLastUpdated() int64

func (*ChainIndex) GetPower

func (x *ChainIndex) GetPower() map[string]*Power

func (*ChainIndex) ProtoMessage

func (*ChainIndex) ProtoMessage()

func (*ChainIndex) ProtoReflect

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

func (*ChainIndex) Reset

func (x *ChainIndex) Reset()

func (*ChainIndex) String

func (x *ChainIndex) String() string

type GetReply

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

func (*GetReply) Descriptor deprecated

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

Deprecated: Use GetReply.ProtoReflect.Descriptor instead.

func (*GetReply) GetIndex

func (x *GetReply) GetIndex() *Index

func (*GetReply) ProtoMessage

func (*GetReply) ProtoMessage()

func (*GetReply) ProtoReflect

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

func (*GetReply) Reset

func (x *GetReply) Reset()

func (*GetReply) String

func (x *GetReply) String() string

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 Index

type Index struct {
	Meta  *MetaIndex  `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	Chain *ChainIndex `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() *ChainIndex

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 float32 `protobuf:"fixed32,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
	Latitude  float32 `protobuf:"fixed32,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() float32

func (*Location) GetLongitude

func (x *Location) GetLongitude() float32

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=lastUpdated,proto3" json:"lastUpdated,omitempty"`
	UserAgent   string    `protobuf:"bytes,2,opt,name=userAgent,proto3" json:"userAgent,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 Power

type Power struct {
	Power    uint64  `protobuf:"varint,1,opt,name=power,proto3" json:"power,omitempty"`
	Relative float32 `protobuf:"fixed32,2,opt,name=relative,proto3" json:"relative,omitempty"`
	// contains filtered or unexported fields
}

func (*Power) Descriptor deprecated

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

Deprecated: Use Power.ProtoReflect.Descriptor instead.

func (*Power) GetPower

func (x *Power) GetPower() uint64

func (*Power) GetRelative

func (x *Power) GetRelative() float32

func (*Power) ProtoMessage

func (*Power) ProtoMessage()

func (*Power) ProtoReflect

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

func (*Power) Reset

func (x *Power) Reset()

func (*Power) String

func (x *Power) String() string

type RPC

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

RPC implements the gprc service

func New

func New(mi *miner.Index) *RPC

New creates a new rpc service

func (*RPC) Get

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

Get calls miner index Get

type RPCClient

type RPCClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error)
}

RPCClient is the client API for RPC service.

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

func NewRPCClient

func NewRPCClient(cc grpc.ClientConnInterface) RPCClient

type RPCServer

type RPCServer interface {
	Get(context.Context, *GetRequest) (*GetReply, error)
}

RPCServer is the server API for RPC service.

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServer) Get

Jump to

Keyboard shortcuts

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