rpc

package
v0.0.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*ChainIndex) Descriptor

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

func (*ChainIndex) GetLastUpdated

func (m *ChainIndex) GetLastUpdated() int64

func (*ChainIndex) GetPower

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

func (*ChainIndex) ProtoMessage

func (*ChainIndex) ProtoMessage()

func (*ChainIndex) Reset

func (m *ChainIndex) Reset()

func (*ChainIndex) String

func (m *ChainIndex) String() string

func (*ChainIndex) XXX_DiscardUnknown

func (m *ChainIndex) XXX_DiscardUnknown()

func (*ChainIndex) XXX_Marshal

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

func (*ChainIndex) XXX_Merge

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

func (*ChainIndex) XXX_Size

func (m *ChainIndex) XXX_Size() int

func (*ChainIndex) XXX_Unmarshal

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

type GetReply

type GetReply struct {
	Index                *Index   `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetReply) Descriptor

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

func (*GetReply) GetIndex

func (m *GetReply) GetIndex() *Index

func (*GetReply) ProtoMessage

func (*GetReply) ProtoMessage()

func (*GetReply) Reset

func (m *GetReply) Reset()

func (*GetReply) String

func (m *GetReply) String() string

func (*GetReply) XXX_DiscardUnknown

func (m *GetReply) XXX_DiscardUnknown()

func (*GetReply) XXX_Marshal

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

func (*GetReply) XXX_Merge

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

func (*GetReply) XXX_Size

func (m *GetReply) XXX_Size() int

func (*GetReply) XXX_Unmarshal

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

type GetRequest

type GetRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

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

func (*GetRequest) XXX_Merge

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

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

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

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"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*Index) Descriptor

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

func (*Index) GetChain

func (m *Index) GetChain() *ChainIndex

func (*Index) GetMeta

func (m *Index) GetMeta() *MetaIndex

func (*Index) ProtoMessage

func (*Index) ProtoMessage()

func (*Index) Reset

func (m *Index) Reset()

func (*Index) String

func (m *Index) String() string

func (*Index) XXX_DiscardUnknown

func (m *Index) XXX_DiscardUnknown()

func (*Index) XXX_Marshal

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

func (*Index) XXX_Merge

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

func (*Index) XXX_Size

func (m *Index) XXX_Size() int

func (*Index) XXX_Unmarshal

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

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Location) Descriptor

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

func (*Location) GetCountry

func (m *Location) GetCountry() string

func (*Location) GetLatitude

func (m *Location) GetLatitude() float32

func (*Location) GetLongitude

func (m *Location) GetLongitude() float32

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) Reset

func (m *Location) Reset()

func (*Location) String

func (m *Location) String() string

func (*Location) XXX_DiscardUnknown

func (m *Location) XXX_DiscardUnknown()

func (*Location) XXX_Marshal

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

func (*Location) XXX_Merge

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

func (*Location) XXX_Size

func (m *Location) XXX_Size() int

func (*Location) XXX_Unmarshal

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

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"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*Meta) Descriptor

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

func (*Meta) GetLastUpdated

func (m *Meta) GetLastUpdated() int64

func (*Meta) GetLocation

func (m *Meta) GetLocation() *Location

func (*Meta) GetOnline

func (m *Meta) GetOnline() bool

func (*Meta) GetUserAgent

func (m *Meta) GetUserAgent() string

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) Reset

func (m *Meta) Reset()

func (*Meta) String

func (m *Meta) String() string

func (*Meta) XXX_DiscardUnknown

func (m *Meta) XXX_DiscardUnknown()

func (*Meta) XXX_Marshal

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

func (*Meta) XXX_Merge

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

func (*Meta) XXX_Size

func (m *Meta) XXX_Size() int

func (*Meta) XXX_Unmarshal

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

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 */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*MetaIndex) Descriptor

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

func (*MetaIndex) GetInfo

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

func (*MetaIndex) GetOffline

func (m *MetaIndex) GetOffline() uint32

func (*MetaIndex) GetOnline

func (m *MetaIndex) GetOnline() uint32

func (*MetaIndex) ProtoMessage

func (*MetaIndex) ProtoMessage()

func (*MetaIndex) Reset

func (m *MetaIndex) Reset()

func (*MetaIndex) String

func (m *MetaIndex) String() string

func (*MetaIndex) XXX_DiscardUnknown

func (m *MetaIndex) XXX_DiscardUnknown()

func (*MetaIndex) XXX_Marshal

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

func (*MetaIndex) XXX_Merge

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

func (*MetaIndex) XXX_Size

func (m *MetaIndex) XXX_Size() int

func (*MetaIndex) XXX_Unmarshal

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

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Power) Descriptor

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

func (*Power) GetPower

func (m *Power) GetPower() uint64

func (*Power) GetRelative

func (m *Power) GetRelative() float32

func (*Power) ProtoMessage

func (*Power) ProtoMessage()

func (*Power) Reset

func (m *Power) Reset()

func (*Power) String

func (m *Power) String() string

func (*Power) XXX_DiscardUnknown

func (m *Power) XXX_DiscardUnknown()

func (*Power) XXX_Marshal

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

func (*Power) XXX_Merge

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

func (*Power) XXX_Size

func (m *Power) XXX_Size() int

func (*Power) XXX_Unmarshal

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

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.ClientConn) 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