msgswap

package
v0.0.0-...-727b8d0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_follow_proto protoreflect.FileDescriptor
View Source
var File_message_proto protoreflect.FileDescriptor
View Source
var FollowID = protocol.ID("/follow/1.0.0")

FollowID ...

View Source
var ID = protocol.ID("/msgSwap/1.0.0")

ID ...

Functions

func FollowHandleStream

func FollowHandleStream(callback func(*NewFollower)) network.StreamHandler

FollowHandleStream ...

func HandleStream

func HandleStream(callback func(*EncryptedMessage)) network.StreamHandler

HandleStream ...

func NewMessage

func NewMessage(from ic.PrivKey, nonce uint64, to string, content string)

NewMessage ...

Types

type EncryptedMessage

type EncryptedMessage struct {
	Reciever     []byte `protobuf:"bytes,1,opt,name=reciever,proto3" json:"reciever,omitempty"`
	EncryptedKey []byte `protobuf:"bytes,2,opt,name=encryptedKey,proto3" json:"encryptedKey,omitempty"`
	Message      []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*EncryptedMessage) Decrypt

func (m *EncryptedMessage) Decrypt(privRSAKey []byte) (*Message, error)

Decrypt ...

func (*EncryptedMessage) Descriptor deprecated

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

Deprecated: Use EncryptedMessage.ProtoReflect.Descriptor instead.

func (*EncryptedMessage) GetEncryptedKey

func (x *EncryptedMessage) GetEncryptedKey() []byte

func (*EncryptedMessage) GetMessage

func (x *EncryptedMessage) GetMessage() []byte

func (*EncryptedMessage) GetReciever

func (x *EncryptedMessage) GetReciever() []byte

func (*EncryptedMessage) ProtoMessage

func (*EncryptedMessage) ProtoMessage()

func (*EncryptedMessage) ProtoReflect

func (x *EncryptedMessage) ProtoReflect() protoreflect.Message

func (*EncryptedMessage) Reset

func (x *EncryptedMessage) Reset()

func (*EncryptedMessage) String

func (x *EncryptedMessage) String() string

type Message

type Message struct {
	Content   []byte          `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	Topic     []byte          `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	TopicID   []byte          `protobuf:"bytes,3,opt,name=topicID,proto3" json:"topicID,omitempty"`
	Time      []byte          `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
	Reciever  []byte          `protobuf:"bytes,5,opt,name=reciever,proto3" json:"reciever,omitempty"`
	Address   *domain.Address `protobuf:"bytes,10,opt,name=address,proto3" json:"address,omitempty"`
	Signature []byte          `protobuf:"bytes,9,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) Encrypt

func (m *Message) Encrypt(pubRSAKey []byte) (*EncryptedMessage, error)

Encrypt ...

func (*Message) GetAddress

func (x *Message) GetAddress() *domain.Address

func (*Message) GetContent

func (x *Message) GetContent() []byte

func (*Message) GetReciever

func (x *Message) GetReciever() []byte

func (*Message) GetSignature

func (x *Message) GetSignature() []byte

func (*Message) GetTime

func (x *Message) GetTime() []byte

func (*Message) GetTopic

func (x *Message) GetTopic() []byte

func (*Message) GetTopicID

func (x *Message) GetTopicID() []byte

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) Sign

func (m *Message) Sign(privateAddress *domain.PrivateAddress) error

Sign ...

func (*Message) String

func (x *Message) String() string

func (*Message) Verify

func (m *Message) Verify() (bool, error)

Verify ...

type NewFollower

type NewFollower struct {
	Reciever  []byte `protobuf:"bytes,1,opt,name=reciever,proto3" json:"reciever,omitempty"`
	Name      []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Nonce     []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
	PubKey    []byte `protobuf:"bytes,4,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
	Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*NewFollower) Descriptor deprecated

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

Deprecated: Use NewFollower.ProtoReflect.Descriptor instead.

func (*NewFollower) GetName

func (x *NewFollower) GetName() []byte

func (*NewFollower) GetNonce

func (x *NewFollower) GetNonce() []byte

func (*NewFollower) GetPubKey

func (x *NewFollower) GetPubKey() []byte

func (*NewFollower) GetReciever

func (x *NewFollower) GetReciever() []byte

func (*NewFollower) GetSignature

func (x *NewFollower) GetSignature() []byte

func (*NewFollower) ProtoMessage

func (*NewFollower) ProtoMessage()

func (*NewFollower) ProtoReflect

func (x *NewFollower) ProtoReflect() protoreflect.Message

func (*NewFollower) Reset

func (x *NewFollower) Reset()

func (*NewFollower) String

func (x *NewFollower) String() string

type StoredMessage

type StoredMessage struct {
	ID string
	Message
}

StoredMessage ...

Jump to

Keyboard shortcuts

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