peer_api

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCPeerServiceServiceID = "peer.api.PeerService"

Variables

This section is empty.

Functions

func NewSRPCPeerServiceHandler

func NewSRPCPeerServiceHandler(impl SRPCPeerServiceServer, serviceID string) srpc.Handler

NewSRPCPeerServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: peer.api.PeerService

func SRPCRegisterPeerService

func SRPCRegisterPeerService(mux srpc.Mux, impl SRPCPeerServiceServer) error

SRPCRegisterPeerService registers the implementation with the mux. Uses the default serviceID: peer.api.PeerService

Types

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:"peerId,omitempty"`
	// contains filtered or unexported fields
}

GetPeerInfoRequest is the request type for GetPeerInfo.

func (*GetPeerInfoRequest) CloneMessageVT

func (m *GetPeerInfoRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*GetPeerInfoRequest) CloneVT

func (m *GetPeerInfoRequest) CloneVT() *GetPeerInfoRequest

func (*GetPeerInfoRequest) EqualMessageVT

func (this *GetPeerInfoRequest) EqualMessageVT(thatMsg any) bool

func (*GetPeerInfoRequest) EqualVT

func (this *GetPeerInfoRequest) EqualVT(that *GetPeerInfoRequest) bool

func (*GetPeerInfoRequest) GetPeerId

func (x *GetPeerInfoRequest) GetPeerId() string

func (*GetPeerInfoRequest) MarshalJSON

func (x *GetPeerInfoRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the GetPeerInfoRequest to JSON.

func (*GetPeerInfoRequest) MarshalProtoJSON

func (x *GetPeerInfoRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the GetPeerInfoRequest message to JSON.

func (*GetPeerInfoRequest) MarshalProtoText

func (x *GetPeerInfoRequest) MarshalProtoText() string

func (*GetPeerInfoRequest) MarshalToSizedBufferVT

func (m *GetPeerInfoRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetPeerInfoRequest) MarshalToVT

func (m *GetPeerInfoRequest) MarshalToVT(dAtA []byte) (int, error)

func (*GetPeerInfoRequest) MarshalVT

func (m *GetPeerInfoRequest) MarshalVT() (dAtA []byte, err error)

func (*GetPeerInfoRequest) ProtoMessage

func (*GetPeerInfoRequest) ProtoMessage()

func (*GetPeerInfoRequest) Reset

func (x *GetPeerInfoRequest) Reset()

func (*GetPeerInfoRequest) SizeVT

func (m *GetPeerInfoRequest) SizeVT() (n int)

func (*GetPeerInfoRequest) String

func (x *GetPeerInfoRequest) String() string

func (*GetPeerInfoRequest) UnmarshalJSON

func (x *GetPeerInfoRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the GetPeerInfoRequest from JSON.

func (*GetPeerInfoRequest) UnmarshalProtoJSON

func (x *GetPeerInfoRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the GetPeerInfoRequest message from JSON.

func (*GetPeerInfoRequest) UnmarshalVT

func (m *GetPeerInfoRequest) UnmarshalVT(dAtA []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:"localPeers,omitempty"`
	// contains filtered or unexported fields
}

GetPeerInfoResponse is the response type for GetPeerInfo.

func (*GetPeerInfoResponse) CloneMessageVT

func (*GetPeerInfoResponse) CloneVT

func (*GetPeerInfoResponse) EqualMessageVT

func (this *GetPeerInfoResponse) EqualMessageVT(thatMsg any) bool

func (*GetPeerInfoResponse) EqualVT

func (this *GetPeerInfoResponse) EqualVT(that *GetPeerInfoResponse) bool

func (*GetPeerInfoResponse) GetLocalPeers

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

func (*GetPeerInfoResponse) MarshalJSON

func (x *GetPeerInfoResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the GetPeerInfoResponse to JSON.

func (*GetPeerInfoResponse) MarshalProtoJSON

func (x *GetPeerInfoResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the GetPeerInfoResponse message to JSON.

func (*GetPeerInfoResponse) MarshalProtoText

func (x *GetPeerInfoResponse) MarshalProtoText() string

func (*GetPeerInfoResponse) MarshalToSizedBufferVT

func (m *GetPeerInfoResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetPeerInfoResponse) MarshalToVT

func (m *GetPeerInfoResponse) MarshalToVT(dAtA []byte) (int, error)

func (*GetPeerInfoResponse) MarshalVT

func (m *GetPeerInfoResponse) MarshalVT() (dAtA []byte, err error)

func (*GetPeerInfoResponse) ProtoMessage

func (*GetPeerInfoResponse) ProtoMessage()

func (*GetPeerInfoResponse) Reset

func (x *GetPeerInfoResponse) Reset()

func (*GetPeerInfoResponse) SizeVT

func (m *GetPeerInfoResponse) SizeVT() (n int)

func (*GetPeerInfoResponse) String

func (x *GetPeerInfoResponse) String() string

func (*GetPeerInfoResponse) UnmarshalJSON

func (x *GetPeerInfoResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the GetPeerInfoResponse from JSON.

func (*GetPeerInfoResponse) UnmarshalProtoJSON

func (x *GetPeerInfoResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the GetPeerInfoResponse message from JSON.

func (*GetPeerInfoResponse) UnmarshalVT

func (m *GetPeerInfoResponse) UnmarshalVT(dAtA []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"`
	// contains filtered or unexported fields
}

IdentifyRequest is a request to load an identity.

func (*IdentifyRequest) CloneMessageVT

func (m *IdentifyRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*IdentifyRequest) CloneVT

func (m *IdentifyRequest) CloneVT() *IdentifyRequest

func (*IdentifyRequest) EqualMessageVT

func (this *IdentifyRequest) EqualMessageVT(thatMsg any) bool

func (*IdentifyRequest) EqualVT

func (this *IdentifyRequest) EqualVT(that *IdentifyRequest) bool

func (*IdentifyRequest) GetConfig

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

func (*IdentifyRequest) MarshalJSON

func (x *IdentifyRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the IdentifyRequest to JSON.

func (*IdentifyRequest) MarshalProtoJSON

func (x *IdentifyRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the IdentifyRequest message to JSON.

func (*IdentifyRequest) MarshalProtoText

func (x *IdentifyRequest) MarshalProtoText() string

func (*IdentifyRequest) MarshalToSizedBufferVT

func (m *IdentifyRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*IdentifyRequest) MarshalToVT

func (m *IdentifyRequest) MarshalToVT(dAtA []byte) (int, error)

func (*IdentifyRequest) MarshalVT

func (m *IdentifyRequest) MarshalVT() (dAtA []byte, err error)

func (*IdentifyRequest) ProtoMessage

func (*IdentifyRequest) ProtoMessage()

func (*IdentifyRequest) Reset

func (x *IdentifyRequest) Reset()

func (*IdentifyRequest) SizeVT

func (m *IdentifyRequest) SizeVT() (n int)

func (*IdentifyRequest) String

func (x *IdentifyRequest) String() string

func (*IdentifyRequest) UnmarshalJSON

func (x *IdentifyRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the IdentifyRequest from JSON.

func (*IdentifyRequest) UnmarshalProtoJSON

func (x *IdentifyRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the IdentifyRequest message from JSON.

func (*IdentifyRequest) UnmarshalVT

func (m *IdentifyRequest) UnmarshalVT(dAtA []byte) error

type IdentifyResponse

type IdentifyResponse struct {

	// ControllerStatus is the status of the peer controller.
	ControllerStatus exec.ControllerStatus `protobuf:"varint,1,opt,name=controller_status,json=controllerStatus,proto3" json:"controllerStatus,omitempty"`
	// contains filtered or unexported fields
}

IdentifyResponse is a response to an identify request.

func (*IdentifyResponse) CloneMessageVT

func (m *IdentifyResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*IdentifyResponse) CloneVT

func (m *IdentifyResponse) CloneVT() *IdentifyResponse

func (*IdentifyResponse) EqualMessageVT

func (this *IdentifyResponse) EqualMessageVT(thatMsg any) bool

func (*IdentifyResponse) EqualVT

func (this *IdentifyResponse) EqualVT(that *IdentifyResponse) bool

func (*IdentifyResponse) GetControllerStatus

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

func (*IdentifyResponse) MarshalJSON

func (x *IdentifyResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the IdentifyResponse to JSON.

func (*IdentifyResponse) MarshalProtoJSON

func (x *IdentifyResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the IdentifyResponse message to JSON.

func (*IdentifyResponse) MarshalProtoText

func (x *IdentifyResponse) MarshalProtoText() string

func (*IdentifyResponse) MarshalToSizedBufferVT

func (m *IdentifyResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*IdentifyResponse) MarshalToVT

func (m *IdentifyResponse) MarshalToVT(dAtA []byte) (int, error)

func (*IdentifyResponse) MarshalVT

func (m *IdentifyResponse) MarshalVT() (dAtA []byte, err error)

func (*IdentifyResponse) ProtoMessage

func (*IdentifyResponse) ProtoMessage()

func (*IdentifyResponse) Reset

func (x *IdentifyResponse) Reset()

func (*IdentifyResponse) SizeVT

func (m *IdentifyResponse) SizeVT() (n int)

func (*IdentifyResponse) String

func (x *IdentifyResponse) String() string

func (*IdentifyResponse) UnmarshalJSON

func (x *IdentifyResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the IdentifyResponse from JSON.

func (*IdentifyResponse) UnmarshalProtoJSON

func (x *IdentifyResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the IdentifyResponse message from JSON.

func (*IdentifyResponse) UnmarshalVT

func (m *IdentifyResponse) UnmarshalVT(dAtA []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:"peerId,omitempty"`
	// contains filtered or unexported fields
}

PeerInfo is basic information about a peer.

func NewPeerInfo

func NewPeerInfo(p peer.Peer) *PeerInfo

NewPeerInfo builds peer info from a peer.

func (*PeerInfo) CloneMessageVT

func (m *PeerInfo) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*PeerInfo) CloneVT

func (m *PeerInfo) CloneVT() *PeerInfo

func (*PeerInfo) EqualMessageVT

func (this *PeerInfo) EqualMessageVT(thatMsg any) bool

func (*PeerInfo) EqualVT

func (this *PeerInfo) EqualVT(that *PeerInfo) bool

func (*PeerInfo) GetPeerId

func (x *PeerInfo) GetPeerId() string

func (*PeerInfo) MarshalJSON

func (x *PeerInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PeerInfo to JSON.

func (*PeerInfo) MarshalProtoJSON

func (x *PeerInfo) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PeerInfo message to JSON.

func (*PeerInfo) MarshalProtoText

func (x *PeerInfo) MarshalProtoText() string

func (*PeerInfo) MarshalToSizedBufferVT

func (m *PeerInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PeerInfo) MarshalToVT

func (m *PeerInfo) MarshalToVT(dAtA []byte) (int, error)

func (*PeerInfo) MarshalVT

func (m *PeerInfo) MarshalVT() (dAtA []byte, err error)

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) Reset

func (x *PeerInfo) Reset()

func (*PeerInfo) SizeVT

func (m *PeerInfo) SizeVT() (n int)

func (*PeerInfo) String

func (x *PeerInfo) String() string

func (*PeerInfo) UnmarshalJSON

func (x *PeerInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PeerInfo from JSON.

func (*PeerInfo) UnmarshalProtoJSON

func (x *PeerInfo) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PeerInfo message from JSON.

func (*PeerInfo) UnmarshalVT

func (m *PeerInfo) UnmarshalVT(dAtA []byte) error

type SRPCPeerServiceClient

type SRPCPeerServiceClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// Identify loads and manages a private key identity.
	Identify(ctx context.Context, in *IdentifyRequest) (SRPCPeerService_IdentifyClient, error)
	// GetPeerInfo returns information about attached peers.
	GetPeerInfo(ctx context.Context, in *GetPeerInfoRequest) (*GetPeerInfoResponse, error)
}

func NewSRPCPeerServiceClient

func NewSRPCPeerServiceClient(cc srpc.Client) SRPCPeerServiceClient

func NewSRPCPeerServiceClientWithServiceID

func NewSRPCPeerServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCPeerServiceClient

type SRPCPeerServiceHandler

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

func (SRPCPeerServiceHandler) GetMethodIDs

func (SRPCPeerServiceHandler) GetMethodIDs() []string

func (*SRPCPeerServiceHandler) GetServiceID

func (d *SRPCPeerServiceHandler) GetServiceID() string

func (*SRPCPeerServiceHandler) InvokeMethod

func (d *SRPCPeerServiceHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCPeerServiceHandler) InvokeMethod_GetPeerInfo

func (SRPCPeerServiceHandler) InvokeMethod_GetPeerInfo(impl SRPCPeerServiceServer, strm srpc.Stream) error

func (SRPCPeerServiceHandler) InvokeMethod_Identify

func (SRPCPeerServiceHandler) InvokeMethod_Identify(impl SRPCPeerServiceServer, strm srpc.Stream) error

type SRPCPeerServiceServer

type SRPCPeerServiceServer interface {
	// Identify loads and manages a private key identity.
	Identify(*IdentifyRequest, SRPCPeerService_IdentifyStream) error
	// GetPeerInfo returns information about attached peers.
	GetPeerInfo(context.Context, *GetPeerInfoRequest) (*GetPeerInfoResponse, error)
}

type SRPCPeerService_GetPeerInfoStream

type SRPCPeerService_GetPeerInfoStream interface {
	srpc.Stream
}

type SRPCPeerService_IdentifyClient

type SRPCPeerService_IdentifyClient interface {
	srpc.Stream
	Recv() (*IdentifyResponse, error)
	RecvTo(*IdentifyResponse) error
}

type SRPCPeerService_IdentifyStream

type SRPCPeerService_IdentifyStream interface {
	srpc.Stream
	Send(*IdentifyResponse) error
	SendAndClose(*IdentifyResponse) error
}

Jump to

Keyboard shortcuts

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