peer_api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DRPCRegisterPeerService

func DRPCRegisterPeerService(mux drpc.Mux, impl DRPCPeerServiceServer) error

Types

type DRPCPeerServiceClient

type DRPCPeerServiceClient interface {
	DRPCConn() drpc.Conn

	Identify(ctx context.Context, in *IdentifyRequest) (DRPCPeerService_IdentifyClient, error)
	GetPeerInfo(ctx context.Context, in *GetPeerInfoRequest) (*GetPeerInfoResponse, error)
}

func NewDRPCPeerServiceClient

func NewDRPCPeerServiceClient(cc drpc.Conn) DRPCPeerServiceClient

type DRPCPeerServiceDescription

type DRPCPeerServiceDescription struct{}

func (DRPCPeerServiceDescription) Method

func (DRPCPeerServiceDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

func (DRPCPeerServiceDescription) NumMethods

func (DRPCPeerServiceDescription) NumMethods() int

type DRPCPeerServiceServer

type DRPCPeerServiceServer interface {
	Identify(*IdentifyRequest, DRPCPeerService_IdentifyStream) error
	GetPeerInfo(context.Context, *GetPeerInfoRequest) (*GetPeerInfoResponse, error)
}

type DRPCPeerServiceUnimplementedServer

type DRPCPeerServiceUnimplementedServer struct{}

func (*DRPCPeerServiceUnimplementedServer) GetPeerInfo

func (*DRPCPeerServiceUnimplementedServer) Identify

type DRPCPeerService_GetPeerInfoStream

type DRPCPeerService_GetPeerInfoStream interface {
	drpc.Stream
	SendAndClose(*GetPeerInfoResponse) error
}

type DRPCPeerService_IdentifyClient

type DRPCPeerService_IdentifyClient interface {
	drpc.Stream
	Recv() (*IdentifyResponse, error)
}

type DRPCPeerService_IdentifyStream

type DRPCPeerService_IdentifyStream interface {
	drpc.Stream
	Send(*IdentifyResponse) error
}

type GetPeerInfoRequest

type GetPeerInfoRequest struct {
	// PeerId restricts the response to a specific peer ID.
	PeerId               string   `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

GetPeerInfoRequest is the request type for GetPeerInfo.

func (*GetPeerInfoRequest) Descriptor

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

func (*GetPeerInfoRequest) GetPeerId

func (m *GetPeerInfoRequest) GetPeerId() string

func (*GetPeerInfoRequest) ProtoMessage

func (*GetPeerInfoRequest) ProtoMessage()

func (*GetPeerInfoRequest) Reset

func (m *GetPeerInfoRequest) Reset()

func (*GetPeerInfoRequest) String

func (m *GetPeerInfoRequest) String() string

func (*GetPeerInfoRequest) XXX_DiscardUnknown

func (m *GetPeerInfoRequest) XXX_DiscardUnknown()

func (*GetPeerInfoRequest) XXX_Marshal

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

func (*GetPeerInfoRequest) XXX_Merge

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

func (*GetPeerInfoRequest) XXX_Size

func (m *GetPeerInfoRequest) XXX_Size() int

func (*GetPeerInfoRequest) XXX_Unmarshal

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

type GetPeerInfoResponse

type GetPeerInfoResponse struct {
	// LocalPeers is the set of peers loaded.
	LocalPeers           []*PeerInfo `protobuf:"bytes,1,rep,name=local_peers,json=localPeers,proto3" json:"local_peers,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

GetPeerInfoResponse is the response type for GetPeerInfo.

func (*GetPeerInfoResponse) Descriptor

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

func (*GetPeerInfoResponse) GetLocalPeers

func (m *GetPeerInfoResponse) GetLocalPeers() []*PeerInfo

func (*GetPeerInfoResponse) ProtoMessage

func (*GetPeerInfoResponse) ProtoMessage()

func (*GetPeerInfoResponse) Reset

func (m *GetPeerInfoResponse) Reset()

func (*GetPeerInfoResponse) String

func (m *GetPeerInfoResponse) String() string

func (*GetPeerInfoResponse) XXX_DiscardUnknown

func (m *GetPeerInfoResponse) XXX_DiscardUnknown()

func (*GetPeerInfoResponse) XXX_Marshal

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

func (*GetPeerInfoResponse) XXX_Merge

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

func (*GetPeerInfoResponse) XXX_Size

func (m *GetPeerInfoResponse) XXX_Size() int

func (*GetPeerInfoResponse) XXX_Unmarshal

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

type IdentifyRequest

type IdentifyRequest struct {
	// Config is the request to configure the peer controller.
	Config               *controller.Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

IdentifyRequest is a request to load an identity.

func (*IdentifyRequest) Descriptor

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

func (*IdentifyRequest) GetConfig

func (m *IdentifyRequest) GetConfig() *controller.Config

func (*IdentifyRequest) ProtoMessage

func (*IdentifyRequest) ProtoMessage()

func (*IdentifyRequest) Reset

func (m *IdentifyRequest) Reset()

func (*IdentifyRequest) String

func (m *IdentifyRequest) String() string

func (*IdentifyRequest) XXX_DiscardUnknown

func (m *IdentifyRequest) XXX_DiscardUnknown()

func (*IdentifyRequest) XXX_Marshal

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

func (*IdentifyRequest) XXX_Merge

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

func (*IdentifyRequest) XXX_Size

func (m *IdentifyRequest) XXX_Size() int

func (*IdentifyRequest) XXX_Unmarshal

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

type IdentifyResponse

type IdentifyResponse struct {
	// ControllerStatus is the status of the peer controller.
	ControllerStatus     exec.ControllerStatus `` /* 148-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

IdentifyResponse is a response to an identify request.

func (*IdentifyResponse) Descriptor

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

func (*IdentifyResponse) GetControllerStatus

func (m *IdentifyResponse) GetControllerStatus() exec.ControllerStatus

func (*IdentifyResponse) ProtoMessage

func (*IdentifyResponse) ProtoMessage()

func (*IdentifyResponse) Reset

func (m *IdentifyResponse) Reset()

func (*IdentifyResponse) String

func (m *IdentifyResponse) String() string

func (*IdentifyResponse) XXX_DiscardUnknown

func (m *IdentifyResponse) XXX_DiscardUnknown()

func (*IdentifyResponse) XXX_Marshal

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

func (*IdentifyResponse) XXX_Merge

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

func (*IdentifyResponse) XXX_Size

func (m *IdentifyResponse) XXX_Size() int

func (*IdentifyResponse) XXX_Unmarshal

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

type PeerInfo

type PeerInfo struct {
	// PeerId is the b58 peer ID.
	PeerId               string   `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

PeerInfo is basic information about a peer.

func NewPeerInfo

func NewPeerInfo(p peer.Peer) (*PeerInfo, error)

NewPeerInfo builds peer info from a peer.

func (*PeerInfo) Descriptor

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

func (*PeerInfo) GetPeerId

func (m *PeerInfo) GetPeerId() string

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) Reset

func (m *PeerInfo) Reset()

func (*PeerInfo) String

func (m *PeerInfo) String() string

func (*PeerInfo) XXX_DiscardUnknown

func (m *PeerInfo) XXX_DiscardUnknown()

func (*PeerInfo) XXX_Marshal

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

func (*PeerInfo) XXX_Merge

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

func (*PeerInfo) XXX_Size

func (m *PeerInfo) XXX_Size() int

func (*PeerInfo) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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