Documentation ¶
Index ¶
- func ConvertClientError(recv *p2ppb.Envelope) error
- func ConvertP2PEnvelopeToError(p2pEnvelope *protocolpb.P2PEnvelope) error
- func ExtractDID(id protocol.ID) (identity.DID, error)
- func PrepareP2PEnvelope(ctx context.Context, networkID uint32, messageType MessageType, ...) (*protocolpb.P2PEnvelope, error)
- func ProtocolForDID(did identity.DID) protocol.ID
- func ResolveDataEnvelope(mes proto.Message) (*p2ppb.Envelope, error)
- type MessageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertClientError ¶
ConvertClientError converts Envelope to error
func ConvertP2PEnvelopeToError ¶
func ConvertP2PEnvelopeToError(p2pEnvelope *protocolpb.P2PEnvelope) error
ConvertP2PEnvelopeToError converts p2pEnvelope containing an error to Error
func ExtractDID ¶
ExtractDID extracts DID from a protocol string
func PrepareP2PEnvelope ¶
func PrepareP2PEnvelope(ctx context.Context, networkID uint32, messageType MessageType, mes proto.Message) (*protocolpb.P2PEnvelope, error)
PrepareP2PEnvelope wraps content message into p2p envelope
func ProtocolForDID ¶
ProtocolForDID creates the protocol string for the given CID
Types ¶
type MessageType ¶
type MessageType string
MessageType holds the protocol message type
const ( // CentrifugeProtocol is the centrifuge wire protocol CentrifugeProtocol protocol.ID = "/centrifuge/0.0.1" // MessageTypeError defines any protocol error MessageTypeError MessageType = "MessageTypeError" // MessageTypeInvalid defines invalid protocol type MessageTypeInvalid MessageType = "MessageTypeInvalid" // MessageTypeRequestSignature defines RequestSignature type MessageTypeRequestSignature MessageType = "MessageTypeRequestSignature" // MessageTypeRequestSignatureRep defines RequestSignature response type MessageTypeRequestSignatureRep MessageType = "MessageTypeRequestSignatureRep" // MessageTypeSendAnchoredDoc defines SendAnchored type MessageTypeSendAnchoredDoc MessageType = "MessageTypeSendAnchoredDoc" // MessageTypeSendAnchoredDocRep defines SendAnchored response type MessageTypeSendAnchoredDocRep MessageType = "MessageTypeSendAnchoredDocRep" //MessageTypeGetDoc defines GetAnchoredDoc type MessageTypeGetDoc MessageType = "MessageTypeGetDoc" //MessageTypeGetDocRep defines GetAnchoredDoc response type MessageTypeGetDocRep MessageType = "MessageTypeGetDocRep" )
func MessageTypeFromString ¶
func MessageTypeFromString(ht string) MessageType
MessageTypeFromString Resolves MessageType out of string
func (MessageType) Equals ¶
func (mt MessageType) Equals(mt2 string) bool
Equals compares if string is of a particular MessageType
Click to show internal directories.
Click to hide internal directories.