Documentation ¶
Index ¶
- Constants
- Variables
- func GetRandomBytes(len int) ([]byte, error)
- func GetRandomNonce() ([]byte, error)
- func NewDelimitedReader(r io2.Reader, maxSize int) io.ReadCloser
- func P2PLayerTestRound(t *testing.T, bootstrapNode *HostNode, node *HostNode)
- func SessionsForMPCTestRound(t *testing.T, bootstrapNode *HostNode, node *HostNode)
- func SessionsTestRound(t *testing.T, bootstrapNode *HostNode, node *HostNode)
- type ConfigService
- type EndpointService
- type HostNode
- type Metrics
- type NetworkStreamSession
- func (n *NetworkStreamSession) Close()
- func (n *NetworkStreamSession) Info() view.SessionInfo
- func (n *NetworkStreamSession) Receive() <-chan *view.Message
- func (n *NetworkStreamSession) Send(payload []byte) error
- func (n *NetworkStreamSession) SendError(payload []byte) error
- func (n *NetworkStreamSession) SendErrorWithContext(ctx context.Context, payload []byte) error
- func (n *NetworkStreamSession) SendWithContext(ctx context.Context, payload []byte) error
- type P2PNode
- func (p *P2PNode) DeleteSessions(_ context.Context, sessionID string)
- func (p *P2PNode) Lookup(peerID string) ([]string, bool)
- func (p *P2PNode) MasterSession() (view.Session, error)
- func (p *P2PNode) NewSession(callerViewID string, contextID string, endpoint string, pkid []byte) (view.Session, error)
- func (p *P2PNode) NewSessionWithID(sessionID, contextID, endpoint string, pkid []byte, caller view.Identity, ...) (view.Session, error)
- func (p *P2PNode) Start(ctx context.Context)
- func (p *P2PNode) Stop()
- type PKExtractor
- type Service
- func (s *Service) Addresses(id view2.Identity) ([]string, error)
- func (s *Service) DeleteSessions(ctx context.Context, sessionID string)
- func (s *Service) MasterSession() (view2.Session, error)
- func (s *Service) NewSession(caller string, contextID string, endpoint string, pkid []byte) (view2.Session, error)
- func (s *Service) NewSessionWithID(sessionID, contextID, endpoint string, pkid []byte, caller view2.Identity, ...) (view2.Session, error)
- func (s *Service) Start(ctx context.Context)
- func (s *Service) Stop()
- type ViewPacket
- func (*ViewPacket) Descriptor() ([]byte, []int)deprecated
- func (x *ViewPacket) GetCaller() string
- func (x *ViewPacket) GetContextID() string
- func (x *ViewPacket) GetPayload() []byte
- func (x *ViewPacket) GetSessionID() string
- func (x *ViewPacket) GetStatus() int32
- func (*ViewPacket) ProtoMessage()
- func (x *ViewPacket) ProtoReflect() protoreflect.Message
- func (x *ViewPacket) Reset()
- func (x *ViewPacket) String() string
Constants ¶
View Source
const (
// NonceSize is the default NonceSize
NonceSize = 24
)
Variables ¶
View Source
var File_messages_proto protoreflect.FileDescriptor
Functions ¶
func GetRandomBytes ¶
GetRandomBytes returns len random looking bytes
func GetRandomNonce ¶
GetRandomNonce returns a random byte array of length NonceSize
func NewDelimitedReader ¶
func NewDelimitedReader(r io2.Reader, maxSize int) io.ReadCloser
func P2PLayerTestRound ¶ added in v0.4.0
func SessionsForMPCTestRound ¶ added in v0.4.0
Types ¶
type ConfigService ¶
type EndpointService ¶
type HostNode ¶ added in v0.4.0
type HostNode struct { *P2PNode ID host2.PeerID Address host2.PeerIPAddress }
type NetworkStreamSession ¶
type NetworkStreamSession struct {
// contains filtered or unexported fields
}
NetworkStreamSession implements view.Session
func (*NetworkStreamSession) Close ¶
func (n *NetworkStreamSession) Close()
Close releases all the resources allocated by this session
func (*NetworkStreamSession) Info ¶
func (n *NetworkStreamSession) Info() view.SessionInfo
func (*NetworkStreamSession) Receive ¶
func (n *NetworkStreamSession) Receive() <-chan *view.Message
Receive returns a channel of messages received from the endpoint
func (*NetworkStreamSession) Send ¶
func (n *NetworkStreamSession) Send(payload []byte) error
Send sends the payload to the endpoint
func (*NetworkStreamSession) SendError ¶
func (n *NetworkStreamSession) SendError(payload []byte) error
SendError sends an error to the endpoint with the passed payload
func (*NetworkStreamSession) SendErrorWithContext ¶ added in v0.4.0
func (n *NetworkStreamSession) SendErrorWithContext(ctx context.Context, payload []byte) error
func (*NetworkStreamSession) SendWithContext ¶ added in v0.4.0
func (n *NetworkStreamSession) SendWithContext(ctx context.Context, payload []byte) error
type P2PNode ¶
type P2PNode struct {
// contains filtered or unexported fields
}
func (*P2PNode) DeleteSessions ¶
func (*P2PNode) NewSession ¶
func (*P2PNode) NewSessionWithID ¶
type PKExtractor ¶ added in v0.4.0
type PKExtractor struct{}
func (*PKExtractor) ExtractPublicKey ¶ added in v0.4.0
func (p *PKExtractor) ExtractPublicKey(id view.Identity) (any, error)
type Service ¶
type Service struct { HostProvider host.GeneratorProvider EndpointService EndpointService ConfigService ConfigService DefaultIdentity view2.Identity Node *P2PNode NodeSync sync.RWMutex // contains filtered or unexported fields }
func NewService ¶
func NewService(hostProvider host.GeneratorProvider, endpointService EndpointService, configService ConfigService, defaultIdentity view2.Identity, tracerProvider trace.TracerProvider, metricsProvider metrics.Provider) (*Service, error)
func (*Service) DeleteSessions ¶
func (*Service) NewSession ¶
func (*Service) NewSessionWithID ¶
type ViewPacket ¶
type ViewPacket struct { SessionID string `protobuf:"bytes,1,opt,name=sessionID,proto3" json:"sessionID,omitempty"` ContextID string `protobuf:"bytes,2,opt,name=contextID,proto3" json:"contextID,omitempty"` Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` Caller string `protobuf:"bytes,5,opt,name=caller,proto3" json:"caller,omitempty"` // contains filtered or unexported fields }
func (*ViewPacket) Descriptor
deprecated
func (*ViewPacket) Descriptor() ([]byte, []int)
Deprecated: Use ViewPacket.ProtoReflect.Descriptor instead.
func (*ViewPacket) GetCaller ¶
func (x *ViewPacket) GetCaller() string
func (*ViewPacket) GetContextID ¶
func (x *ViewPacket) GetContextID() string
func (*ViewPacket) GetPayload ¶
func (x *ViewPacket) GetPayload() []byte
func (*ViewPacket) GetSessionID ¶
func (x *ViewPacket) GetSessionID() string
func (*ViewPacket) GetStatus ¶
func (x *ViewPacket) GetStatus() int32
func (*ViewPacket) ProtoMessage ¶
func (*ViewPacket) ProtoMessage()
func (*ViewPacket) ProtoReflect ¶
func (x *ViewPacket) ProtoReflect() protoreflect.Message
func (*ViewPacket) Reset ¶
func (x *ViewPacket) Reset()
func (*ViewPacket) String ¶
func (x *ViewPacket) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.