peer_api

package
v0.40.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func NewSRPCPeerServiceHandler added in v0.7.2

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

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

func SRPCRegisterPeerService added in v0.3.0

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 added in v0.15.6

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

func (*GetPeerInfoRequest) CloneVT added in v0.8.3

func (m *GetPeerInfoRequest) CloneVT() *GetPeerInfoRequest

func (*GetPeerInfoRequest) EqualMessageVT added in v0.15.6

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

func (*GetPeerInfoRequest) EqualVT added in v0.3.0

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

func (*GetPeerInfoRequest) GetPeerId

func (x *GetPeerInfoRequest) GetPeerId() string

func (*GetPeerInfoRequest) MarshalJSON added in v0.29.0

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

MarshalJSON marshals the GetPeerInfoRequest to JSON.

func (*GetPeerInfoRequest) MarshalProtoJSON added in v0.29.0

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

MarshalProtoJSON marshals the GetPeerInfoRequest message to JSON.

func (*GetPeerInfoRequest) MarshalProtoText added in v0.29.2

func (x *GetPeerInfoRequest) MarshalProtoText() string

func (*GetPeerInfoRequest) MarshalToSizedBufferVT added in v0.2.0

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

func (*GetPeerInfoRequest) MarshalToVT added in v0.2.0

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

func (*GetPeerInfoRequest) MarshalVT added in v0.2.0

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

func (*GetPeerInfoRequest) ProtoMessage

func (*GetPeerInfoRequest) ProtoMessage()

func (*GetPeerInfoRequest) Reset

func (x *GetPeerInfoRequest) Reset()

func (*GetPeerInfoRequest) SizeVT added in v0.2.0

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

func (*GetPeerInfoRequest) String

func (x *GetPeerInfoRequest) String() string

func (*GetPeerInfoRequest) UnmarshalJSON added in v0.29.0

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

UnmarshalJSON unmarshals the GetPeerInfoRequest from JSON.

func (*GetPeerInfoRequest) UnmarshalProtoJSON added in v0.29.0

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

UnmarshalProtoJSON unmarshals the GetPeerInfoRequest message from JSON.

func (*GetPeerInfoRequest) UnmarshalVT added in v0.2.0

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 added in v0.15.6

func (*GetPeerInfoResponse) CloneVT added in v0.8.3

func (*GetPeerInfoResponse) EqualMessageVT added in v0.15.6

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

func (*GetPeerInfoResponse) EqualVT added in v0.3.0

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

func (*GetPeerInfoResponse) GetLocalPeers

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

func (*GetPeerInfoResponse) MarshalJSON added in v0.29.0

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

MarshalJSON marshals the GetPeerInfoResponse to JSON.

func (*GetPeerInfoResponse) MarshalProtoJSON added in v0.29.0

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

MarshalProtoJSON marshals the GetPeerInfoResponse message to JSON.

func (*GetPeerInfoResponse) MarshalProtoText added in v0.29.2

func (x *GetPeerInfoResponse) MarshalProtoText() string

func (*GetPeerInfoResponse) MarshalToSizedBufferVT added in v0.2.0

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

func (*GetPeerInfoResponse) MarshalToVT added in v0.2.0

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

func (*GetPeerInfoResponse) MarshalVT added in v0.2.0

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

func (*GetPeerInfoResponse) ProtoMessage

func (*GetPeerInfoResponse) ProtoMessage()

func (*GetPeerInfoResponse) Reset

func (x *GetPeerInfoResponse) Reset()

func (*GetPeerInfoResponse) SizeVT added in v0.2.0

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

func (*GetPeerInfoResponse) String

func (x *GetPeerInfoResponse) String() string

func (*GetPeerInfoResponse) UnmarshalJSON added in v0.29.0

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

UnmarshalJSON unmarshals the GetPeerInfoResponse from JSON.

func (*GetPeerInfoResponse) UnmarshalProtoJSON added in v0.29.0

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

UnmarshalProtoJSON unmarshals the GetPeerInfoResponse message from JSON.

func (*GetPeerInfoResponse) UnmarshalVT added in v0.2.0

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 added in v0.15.6

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

func (*IdentifyRequest) CloneVT added in v0.8.3

func (m *IdentifyRequest) CloneVT() *IdentifyRequest

func (*IdentifyRequest) EqualMessageVT added in v0.15.6

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

func (*IdentifyRequest) EqualVT added in v0.3.0

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

func (*IdentifyRequest) GetConfig

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

func (*IdentifyRequest) MarshalJSON added in v0.29.0

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

MarshalJSON marshals the IdentifyRequest to JSON.

func (*IdentifyRequest) MarshalProtoJSON added in v0.29.0

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

MarshalProtoJSON marshals the IdentifyRequest message to JSON.

func (*IdentifyRequest) MarshalProtoText added in v0.29.2

func (x *IdentifyRequest) MarshalProtoText() string

func (*IdentifyRequest) MarshalToSizedBufferVT added in v0.2.0

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

func (*IdentifyRequest) MarshalToVT added in v0.2.0

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

func (*IdentifyRequest) MarshalVT added in v0.2.0

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

func (*IdentifyRequest) ProtoMessage

func (*IdentifyRequest) ProtoMessage()

func (*IdentifyRequest) Reset

func (x *IdentifyRequest) Reset()

func (*IdentifyRequest) SizeVT added in v0.2.0

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

func (*IdentifyRequest) String

func (x *IdentifyRequest) String() string

func (*IdentifyRequest) UnmarshalJSON added in v0.29.0

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

UnmarshalJSON unmarshals the IdentifyRequest from JSON.

func (*IdentifyRequest) UnmarshalProtoJSON added in v0.29.0

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

UnmarshalProtoJSON unmarshals the IdentifyRequest message from JSON.

func (*IdentifyRequest) UnmarshalVT added in v0.2.0

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 added in v0.15.6

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

func (*IdentifyResponse) CloneVT added in v0.8.3

func (m *IdentifyResponse) CloneVT() *IdentifyResponse

func (*IdentifyResponse) EqualMessageVT added in v0.15.6

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

func (*IdentifyResponse) EqualVT added in v0.3.0

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

func (*IdentifyResponse) GetControllerStatus

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

func (*IdentifyResponse) MarshalJSON added in v0.29.0

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

MarshalJSON marshals the IdentifyResponse to JSON.

func (*IdentifyResponse) MarshalProtoJSON added in v0.29.0

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

MarshalProtoJSON marshals the IdentifyResponse message to JSON.

func (*IdentifyResponse) MarshalProtoText added in v0.29.2

func (x *IdentifyResponse) MarshalProtoText() string

func (*IdentifyResponse) MarshalToSizedBufferVT added in v0.2.0

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

func (*IdentifyResponse) MarshalToVT added in v0.2.0

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

func (*IdentifyResponse) MarshalVT added in v0.2.0

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

func (*IdentifyResponse) ProtoMessage

func (*IdentifyResponse) ProtoMessage()

func (*IdentifyResponse) Reset

func (x *IdentifyResponse) Reset()

func (*IdentifyResponse) SizeVT added in v0.2.0

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

func (*IdentifyResponse) String

func (x *IdentifyResponse) String() string

func (*IdentifyResponse) UnmarshalJSON added in v0.29.0

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

UnmarshalJSON unmarshals the IdentifyResponse from JSON.

func (*IdentifyResponse) UnmarshalProtoJSON added in v0.29.0

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

UnmarshalProtoJSON unmarshals the IdentifyResponse message from JSON.

func (*IdentifyResponse) UnmarshalVT added in v0.2.0

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 added in v0.15.6

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

func (*PeerInfo) CloneVT added in v0.8.3

func (m *PeerInfo) CloneVT() *PeerInfo

func (*PeerInfo) EqualMessageVT added in v0.15.6

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

func (*PeerInfo) EqualVT added in v0.3.0

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

func (*PeerInfo) GetPeerId

func (x *PeerInfo) GetPeerId() string

func (*PeerInfo) MarshalJSON added in v0.29.0

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

MarshalJSON marshals the PeerInfo to JSON.

func (*PeerInfo) MarshalProtoJSON added in v0.29.0

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

MarshalProtoJSON marshals the PeerInfo message to JSON.

func (*PeerInfo) MarshalProtoText added in v0.29.2

func (x *PeerInfo) MarshalProtoText() string

func (*PeerInfo) MarshalToSizedBufferVT added in v0.2.0

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

func (*PeerInfo) MarshalToVT added in v0.2.0

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

func (*PeerInfo) MarshalVT added in v0.2.0

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

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) Reset

func (x *PeerInfo) Reset()

func (*PeerInfo) SizeVT added in v0.2.0

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

func (*PeerInfo) String

func (x *PeerInfo) String() string

func (*PeerInfo) UnmarshalJSON added in v0.29.0

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

UnmarshalJSON unmarshals the PeerInfo from JSON.

func (*PeerInfo) UnmarshalProtoJSON added in v0.29.0

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

UnmarshalProtoJSON unmarshals the PeerInfo message from JSON.

func (*PeerInfo) UnmarshalVT added in v0.2.0

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

type SRPCPeerServiceClient added in v0.3.0

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 added in v0.3.0

func NewSRPCPeerServiceClient(cc srpc.Client) SRPCPeerServiceClient

func NewSRPCPeerServiceClientWithServiceID added in v0.7.2

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

type SRPCPeerServiceHandler added in v0.3.0

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

func (SRPCPeerServiceHandler) GetMethodIDs added in v0.3.0

func (SRPCPeerServiceHandler) GetMethodIDs() []string

func (*SRPCPeerServiceHandler) GetServiceID added in v0.3.0

func (d *SRPCPeerServiceHandler) GetServiceID() string

func (*SRPCPeerServiceHandler) InvokeMethod added in v0.3.0

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

func (SRPCPeerServiceHandler) InvokeMethod_GetPeerInfo added in v0.3.0

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

func (SRPCPeerServiceHandler) InvokeMethod_Identify added in v0.3.0

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

type SRPCPeerServiceServer added in v0.3.0

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 added in v0.3.0

type SRPCPeerService_GetPeerInfoStream interface {
	srpc.Stream
}

type SRPCPeerService_IdentifyClient added in v0.3.0

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

type SRPCPeerService_IdentifyStream added in v0.3.0

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