meowlib

package module
v0.0.0-...-2e2ebad Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

README

MEOW lib

Documentation generation

required tools

  • protoc
  • protoc-gen-doc
  • protoc-gen-uml
  • go-plantuml
  • plantuml (plantuml command is as shell script : java -jar /<path-to-plantuml>/plantuml-mit-<version>.jar "$@")

generation

run the shell scripts

cd pb
./protogen.sh

cd doc
./docgen.sh

Tests

Design notes

Config is written as a json file Identity is stored as an encrypted json file Message servers (messaging and my contact's messaging) are stored in an encrypted badger db with server url as key Received servers are stored in a sqlite db for selective searches, with storage limits Messages are stored in several badger? or sqlite? db per user with send/receive time as key

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_messages_proto protoreflect.FileDescriptor

Functions

func AsymDecrypt

func AsymDecrypt(PrivateKey string, data []byte) ([]byte, error)

func AsymDecryptAndCheck

func AsymDecryptAndCheck(MyPrivateEncryptionKey string, MyContactPublicKey string, data []byte, Signature []byte) (DecryptedMessage []byte, err error)

func AsymDecryptArmored

func AsymDecryptArmored(PrivateKey string, data []byte) ([]byte, error)

func AsymEncrypt

func AsymEncrypt(publicKey string, data []byte) ([]byte, error)

func AsymEncryptArmored

func AsymEncryptArmored(PublicKey string, data []byte) ([]byte, error)

func BufferMerge

func BufferMerge(packets [][]byte) (buffer []byte, err error)

func BufferSplit

func BufferSplit(buffer []byte, parts uint8) (packets [][]byte, err error)

func HttpGetId

func HttpGetId(url string) (response map[string]string, err error)

func HttpPostMessage

func HttpPostMessage(url string, msg []byte, timeout int) (response []byte, err error)

func SymDecrypt

func SymDecrypt(password string, data []byte) ([]byte, error)

func SymEncrypt

func SymEncrypt(password string, data []byte) ([]byte, error)

Types

type ContactCard

type ContactCard struct {
	Name                string        `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                                            // contact nickname
	ContactPublicKey    string        `protobuf:"bytes,2,opt,name=contact_public_key,json=contactPublicKey,proto3" json:"contact_public_key,omitempty"`          // contact public key, will be used to authenticate her/his messages
	EncryptionPublicKey string        `protobuf:"bytes,3,opt,name=encryption_public_key,json=encryptionPublicKey,proto3" json:"encryption_public_key,omitempty"` // public key you must use to to write encrypted messages to that contact
	LookupPublicKey     string        `protobuf:"bytes,4,opt,name=lookup_public_key,json=lookupPublicKey,proto3" json:"lookup_public_key,omitempty"`             // public key you will use as "destination identifier" for her/him to lookup for your messages on the servers
	PullServers         []*ServerCard `protobuf:"bytes,5,rep,name=pull_servers,json=pullServers,proto3" json:"pull_servers,omitempty"`                           // list the servers where the contact will look for messages from you
	Version             uint32        `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"`
	InvitationId        string        `protobuf:"bytes,7,opt,name=invitation_id,json=invitationId,proto3" json:"invitation_id,omitempty"`
	InvitationMessage   string        `protobuf:"bytes,8,opt,name=invitation_message,json=invitationMessage,proto3" json:"invitation_message,omitempty"`
	// contains filtered or unexported fields
}

structure describing a user contact card ie the minimum set of attributes for exchanging identities

func NewContactCardFromCompressed

func NewContactCardFromCompressed(compressed []byte) (*ContactCard, error)

func NewContactCardFromSplit

func NewContactCardFromSplit(packets [][]byte) (*ContactCard, error)

func ReadQr

func ReadQr(filename string) *ContactCard

func (*ContactCard) AddUrls

func (Contact *ContactCard) AddUrls(urls []string)

func (*ContactCard) Compress

func (contact *ContactCard) Compress() ([]byte, error)

func (*ContactCard) Descriptor deprecated

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

Deprecated: Use ContactCard.ProtoReflect.Descriptor instead.

func (*ContactCard) GetContactPublicKey

func (x *ContactCard) GetContactPublicKey() string

func (*ContactCard) GetEncryptionPublicKey

func (x *ContactCard) GetEncryptionPublicKey() string

func (*ContactCard) GetInvitationId

func (x *ContactCard) GetInvitationId() string

func (*ContactCard) GetInvitationMessage

func (x *ContactCard) GetInvitationMessage() string

func (*ContactCard) GetLookupPublicKey

func (x *ContactCard) GetLookupPublicKey() string

func (*ContactCard) GetName

func (x *ContactCard) GetName() string

func (*ContactCard) GetPullServers

func (x *ContactCard) GetPullServers() []*ServerCard

func (*ContactCard) GetVersion

func (x *ContactCard) GetVersion() uint32

func (*ContactCard) ProtoMessage

func (*ContactCard) ProtoMessage()

func (*ContactCard) ProtoReflect

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

func (*ContactCard) Reset

func (x *ContactCard) Reset()

func (*ContactCard) Serialize

func (contact *ContactCard) Serialize() ([]byte, error)

func (*ContactCard) Split

func (contact *ContactCard) Split(parts uint8) (packets [][]byte, err error)

func (*ContactCard) String

func (x *ContactCard) String() string

func (*ContactCard) WriteCompressed

func (contact *ContactCard) WriteCompressed(filename string) error

func (*ContactCard) WritePng

func (contact *ContactCard) WritePng(filename string)

func (*ContactCard) WriteQr

func (Contact *ContactCard) WriteQr(filename string) error

type ConversationRequest

type ConversationRequest struct {
	LookupKey string `protobuf:"bytes,1,opt,name=lookup_key,json=lookupKey,proto3" json:"lookup_key,omitempty"` // lookup key for a conversation
	// removed string lastServerUuidOK = 2;  //  Last Server message UUID received (send me all after that one)
	SendTimestamp   int64  `protobuf:"varint,2,opt,name=send_timestamp,json=sendTimestamp,proto3" json:"send_timestamp,omitempty"`
	LookupSignature string `protobuf:"bytes,3,opt,name=lookup_signature,json=lookupSignature,proto3" json:"lookup_signature,omitempty"` // prove that I own the private key by signing that block
	// contains filtered or unexported fields
}

structure for requesting incoming messages

func (*ConversationRequest) Descriptor deprecated

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

Deprecated: Use ConversationRequest.ProtoReflect.Descriptor instead.

func (*ConversationRequest) GetLookupKey

func (x *ConversationRequest) GetLookupKey() string

func (*ConversationRequest) GetLookupSignature

func (x *ConversationRequest) GetLookupSignature() string

func (*ConversationRequest) GetSendTimestamp

func (x *ConversationRequest) GetSendTimestamp() int64

func (*ConversationRequest) ProtoMessage

func (*ConversationRequest) ProtoMessage()

func (*ConversationRequest) ProtoReflect

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

func (*ConversationRequest) Reset

func (x *ConversationRequest) Reset()

func (*ConversationRequest) String

func (x *ConversationRequest) String() string

type ConversationResponse

type ConversationResponse struct {
	MessageUuids []string `protobuf:"bytes,1,rep,name=messageUuids,proto3" json:"messageUuids,omitempty"`
	// contains filtered or unexported fields
}

func (*ConversationResponse) Descriptor deprecated

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

Deprecated: Use ConversationResponse.ProtoReflect.Descriptor instead.

func (*ConversationResponse) GetMessageUuids

func (x *ConversationResponse) GetMessageUuids() []string

func (*ConversationResponse) ProtoMessage

func (*ConversationResponse) ProtoMessage()

func (*ConversationResponse) ProtoReflect

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

func (*ConversationResponse) Reset

func (x *ConversationResponse) Reset()

func (*ConversationResponse) String

func (x *ConversationResponse) String() string

type ConversationStatus

type ConversationStatus struct {
	Uuid                string       `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	AnswerToUuid        string       `protobuf:"bytes,2,opt,name=answer_to_uuid,json=answerToUuid,proto3" json:"answer_to_uuid,omitempty"` // message is an answer to another one, specify uuid here
	LocalSequence       uint64       `protobuf:"varint,3,opt,name=localSequence,proto3" json:"localSequence,omitempty"`                    // seq number in local conversation for custom reordering
	Sent                uint64       `protobuf:"varint,4,opt,name=sent,proto3" json:"sent,omitempty"`                                      // timestamp of the message sent
	Received            uint64       `protobuf:"varint,5,opt,name=received,proto3" json:"received,omitempty"`                              // timestamp of the message received
	Processed           uint64       `protobuf:"varint,6,opt,name=processed,proto3" json:"processed,omitempty"`                            // timestamp of the message processed
	MyNextIdentity      *ContactCard `protobuf:"bytes,7,opt,name=my_next_identity,json=myNextIdentity,proto3" json:"my_next_identity,omitempty"`
	PeerNextIdentityAck int32        `protobuf:"varint,8,opt,name=peer_next_identityAck,json=peerNextIdentityAck,proto3" json:"peer_next_identityAck,omitempty"` // version of the new peer accepted id
	// contains filtered or unexported fields
}

func (*ConversationStatus) Descriptor deprecated

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

Deprecated: Use ConversationStatus.ProtoReflect.Descriptor instead.

func (*ConversationStatus) GetAnswerToUuid

func (x *ConversationStatus) GetAnswerToUuid() string

func (*ConversationStatus) GetLocalSequence

func (x *ConversationStatus) GetLocalSequence() uint64

func (*ConversationStatus) GetMyNextIdentity

func (x *ConversationStatus) GetMyNextIdentity() *ContactCard

func (*ConversationStatus) GetPeerNextIdentityAck

func (x *ConversationStatus) GetPeerNextIdentityAck() int32

func (*ConversationStatus) GetProcessed

func (x *ConversationStatus) GetProcessed() uint64

func (*ConversationStatus) GetReceived

func (x *ConversationStatus) GetReceived() uint64

func (*ConversationStatus) GetSent

func (x *ConversationStatus) GetSent() uint64

func (*ConversationStatus) GetUuid

func (x *ConversationStatus) GetUuid() string

func (*ConversationStatus) ProtoMessage

func (*ConversationStatus) ProtoMessage()

func (*ConversationStatus) ProtoReflect

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

func (*ConversationStatus) Reset

func (x *ConversationStatus) Reset()

func (*ConversationStatus) String

func (x *ConversationStatus) String() string

type DbMessage

type DbMessage struct {
	Outbound        bool                `protobuf:"varint,1,opt,name=outbound,proto3" json:"outbound,omitempty"` // direction of the message
	Type            string              `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Data            []byte              `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // text data
	Status          *ConversationStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
	Contact         *ContactCard        `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"`
	Group           *Group              `protobuf:"bytes,6,opt,name=group,proto3" json:"group,omitempty"`
	FilePaths       []string            `protobuf:"bytes,7,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"`
	CurrentLocation *Location           `protobuf:"bytes,8,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"`
	Appdata         []byte              `protobuf:"bytes,9,opt,name=appdata,proto3" json:"appdata,omitempty"`
	Invitation      *Invitation         `protobuf:"bytes,10,opt,name=invitation,proto3" json:"invitation,omitempty"`
	From            string              `protobuf:"bytes,11,opt,name=from,proto3" json:"from,omitempty"` // source peer uid, used when storing group conversations with more than one peer
	// contains filtered or unexported fields
}

func (*DbMessage) Descriptor deprecated

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

Deprecated: Use DbMessage.ProtoReflect.Descriptor instead.

func (*DbMessage) GetAppdata

func (x *DbMessage) GetAppdata() []byte

func (*DbMessage) GetContact

func (x *DbMessage) GetContact() *ContactCard

func (*DbMessage) GetCurrentLocation

func (x *DbMessage) GetCurrentLocation() *Location

func (*DbMessage) GetData

func (x *DbMessage) GetData() []byte

func (*DbMessage) GetFilePaths

func (x *DbMessage) GetFilePaths() []string

func (*DbMessage) GetFrom

func (x *DbMessage) GetFrom() string

func (*DbMessage) GetGroup

func (x *DbMessage) GetGroup() *Group

func (*DbMessage) GetInvitation

func (x *DbMessage) GetInvitation() *Invitation

func (*DbMessage) GetOutbound

func (x *DbMessage) GetOutbound() bool

func (*DbMessage) GetStatus

func (x *DbMessage) GetStatus() *ConversationStatus

func (*DbMessage) GetType

func (x *DbMessage) GetType() string

func (*DbMessage) ProtoMessage

func (*DbMessage) ProtoMessage()

func (*DbMessage) ProtoReflect

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

func (*DbMessage) Reset

func (x *DbMessage) Reset()

func (*DbMessage) String

func (x *DbMessage) String() string

type EncryptedMessage

type EncryptedMessage struct {
	Data      []byte
	Signature []byte
}

func AsymEncryptAndSign

func AsymEncryptAndSign(PublicEncryptionKey string, PrivateSignatureKey string, data []byte) (*EncryptedMessage, error)

type File

type File struct {
	Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // the proposed filename
	Size     uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`        // the file size
	Chunk    uint32 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"`      // the chunk counter if file is sent by chunks
	Data     []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`         // the file/chunk content
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetChunk

func (x *File) GetChunk() uint32

func (*File) GetData

func (x *File) GetData() []byte

func (*File) GetFilename

func (x *File) GetFilename() string

func (*File) GetSize

func (x *File) GetSize() uint64

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

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

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type FromServerMessage

type FromServerMessage struct {
	Type            string               `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`                                                // Type
	ServerPublicKey string               `protobuf:"bytes,2,opt,name=server_public_key,json=serverPublicKey,proto3" json:"server_public_key,omitempty"` // Pub key from the server
	Payload         []byte               `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`                                          //
	UuidAck         string               `protobuf:"bytes,4,opt,name=uuid_ack,json=uuidAck,proto3" json:"uuid_ack,omitempty"`                           // Ack for the last received ToServerMessage Uuid
	ServerUuid      string               `protobuf:"bytes,5,opt,name=server_uuid,json=serverUuid,proto3" json:"server_uuid,omitempty"`                  // Provides the server uuid that replaced the client uuid
	Chat            []*PackedUserMessage `protobuf:"bytes,6,rep,name=chat,proto3" json:"chat,omitempty"`
	KnownServers    []*ServerCard        `protobuf:"bytes,7,rep,name=known_servers,json=knownServers,proto3" json:"known_servers,omitempty"`
	Invitation      *Invitation          `protobuf:"bytes,8,opt,name=invitation,proto3" json:"invitation,omitempty"`                               // invitation answer, for the third steps of any invitation
	DeviceMessages  []*PackedUserMessage `protobuf:"bytes,9,rep,name=device_messages,json=deviceMessages,proto3" json:"device_messages,omitempty"` // messages from other devices belonging to the same user
	// contains filtered or unexported fields
}

structure defining a from server receiver message decrypted from a "packedmessage" payload

func (*FromServerMessage) Descriptor deprecated

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

Deprecated: Use FromServerMessage.ProtoReflect.Descriptor instead.

func (*FromServerMessage) GetChat

func (x *FromServerMessage) GetChat() []*PackedUserMessage

func (*FromServerMessage) GetDeviceMessages

func (x *FromServerMessage) GetDeviceMessages() []*PackedUserMessage

func (*FromServerMessage) GetInvitation

func (x *FromServerMessage) GetInvitation() *Invitation

func (*FromServerMessage) GetKnownServers

func (x *FromServerMessage) GetKnownServers() []*ServerCard

func (*FromServerMessage) GetPayload

func (x *FromServerMessage) GetPayload() []byte

func (*FromServerMessage) GetServerPublicKey

func (x *FromServerMessage) GetServerPublicKey() string

func (*FromServerMessage) GetServerUuid

func (x *FromServerMessage) GetServerUuid() string

func (*FromServerMessage) GetType

func (x *FromServerMessage) GetType() string

func (*FromServerMessage) GetUuidAck

func (x *FromServerMessage) GetUuidAck() string

func (*FromServerMessage) ProtoMessage

func (*FromServerMessage) ProtoMessage()

func (*FromServerMessage) ProtoReflect

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

func (*FromServerMessage) Reset

func (x *FromServerMessage) Reset()

func (*FromServerMessage) String

func (x *FromServerMessage) String() string

type Group

type Group struct {
	Name    string         `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Members []*ContactCard `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"`
	// contains filtered or unexported fields
}

func (*Group) Descriptor deprecated

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

Deprecated: Use Group.ProtoReflect.Descriptor instead.

func (*Group) GetMembers

func (x *Group) GetMembers() []*ContactCard

func (*Group) GetName

func (x *Group) GetName() string

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) ProtoReflect

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

func (*Group) Reset

func (x *Group) Reset()

func (*Group) String

func (x *Group) String() string

type Invitation

type Invitation struct {
	Payload      []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`            // invitation payload, encrypted after step 2
	Timeout      int32  `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"`           // how long do I want the invitation to remain available on the server
	ShortcodeLen int32  `protobuf:"varint,3,opt,name=shortcodeLen,proto3" json:"shortcodeLen,omitempty"` // len of the shortcode you wish for short url transmission
	Shortcode    string `protobuf:"bytes,4,opt,name=shortcode,proto3" json:"shortcode,omitempty"`        // shortcode that the friend shall request to get the invitation
	Password     string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`          // password tou set for accessin invitation (optional)
	Uuid         string `protobuf:"bytes,6,opt,name=uuid,proto3" json:"uuid,omitempty"`                  // id that the friend gave you, that you should include to your reply to get recognized
	Expiry       int64  `protobuf:"varint,7,opt,name=expiry,proto3" json:"expiry,omitempty"`             // the server allowed expiry date, it may be samller than the requested timeout according to server policy
	Step         int32  `protobuf:"varint,8,opt,name=step,proto3" json:"step,omitempty"`                 // progress in the inviattion process : 1=invite friend, 2=friend requests invitation, 3=friend's answer
	From         string `protobuf:"bytes,9,opt,name=from,proto3" json:"from,omitempty"`                  // used in step 3 the answer public key to check the signature in user message
	// contains filtered or unexported fields
}

structure to hold an invitation through a server

func (*Invitation) Descriptor deprecated

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

Deprecated: Use Invitation.ProtoReflect.Descriptor instead.

func (*Invitation) GetExpiry

func (x *Invitation) GetExpiry() int64

func (*Invitation) GetFrom

func (x *Invitation) GetFrom() string

func (*Invitation) GetPassword

func (x *Invitation) GetPassword() string

func (*Invitation) GetPayload

func (x *Invitation) GetPayload() []byte

func (*Invitation) GetShortcode

func (x *Invitation) GetShortcode() string

func (*Invitation) GetShortcodeLen

func (x *Invitation) GetShortcodeLen() int32

func (*Invitation) GetStep

func (x *Invitation) GetStep() int32

func (*Invitation) GetTimeout

func (x *Invitation) GetTimeout() int32

func (*Invitation) GetUuid

func (x *Invitation) GetUuid() string

func (*Invitation) ProtoMessage

func (*Invitation) ProtoMessage()

func (*Invitation) ProtoReflect

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

func (*Invitation) Reset

func (x *Invitation) Reset()

func (*Invitation) String

func (x *Invitation) String() string

type KeyPair

type KeyPair struct {
	Public    string    `json:"public,omitempty"`
	Private   string    `json:"private,omitempty"`
	Generated time.Time `json:"generated,omitempty"`
}

func NewKeyPair

func NewKeyPair() KeyPair

func (*KeyPair) GetCryptoKeyObject

func (Kp *KeyPair) GetCryptoKeyObject() *crypto.Key

type KeysArray

type KeysArray []KeyPair

type Location

type Location struct {
	Time      uint64  `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
	Latitude  float32 `protobuf:"fixed32,2,opt,name=latitude,proto3" json:"latitude,omitempty"`
	Longitude float32 `protobuf:"fixed32,3,opt,name=longitude,proto3" json:"longitude,omitempty"`
	Altitude  int32   `protobuf:"varint,4,opt,name=altitude,proto3" json:"altitude,omitempty"`
	// contains filtered or unexported fields
}

func (*Location) Descriptor deprecated

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

Deprecated: Use Location.ProtoReflect.Descriptor instead.

func (*Location) GetAltitude

func (x *Location) GetAltitude() int32

func (*Location) GetLatitude

func (x *Location) GetLatitude() float32

func (*Location) GetLongitude

func (x *Location) GetLongitude() float32

func (*Location) GetTime

func (x *Location) GetTime() uint64

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) ProtoReflect

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

func (*Location) Reset

func (x *Location) Reset()

func (*Location) String

func (x *Location) String() string

type Matriochka

type Matriochka struct {
	LookupKey string            `protobuf:"bytes,1,opt,name=lookupKey,proto3" json:"lookupKey,omitempty"` // Optional, only if you want delivery tracking, less stealth
	Prev      *MatriochkaServer `protobuf:"bytes,2,opt,name=prev,proto3" json:"prev,omitempty"`           // Optional, like above
	Next      *MatriochkaServer `protobuf:"bytes,3,opt,name=next,proto3" json:"next,omitempty"`           // Next server to deliver the message to
	Data      []byte            `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`           // Matriochka data
	// contains filtered or unexported fields
}

func (*Matriochka) Descriptor deprecated

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

Deprecated: Use Matriochka.ProtoReflect.Descriptor instead.

func (*Matriochka) GetData

func (x *Matriochka) GetData() []byte

func (*Matriochka) GetLookupKey

func (x *Matriochka) GetLookupKey() string

func (*Matriochka) GetNext

func (x *Matriochka) GetNext() *MatriochkaServer

func (*Matriochka) GetPrev

func (x *Matriochka) GetPrev() *MatriochkaServer

func (*Matriochka) ProtoMessage

func (*Matriochka) ProtoMessage()

func (*Matriochka) ProtoReflect

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

func (*Matriochka) Reset

func (x *Matriochka) Reset()

func (*Matriochka) String

func (x *Matriochka) String() string

type MatriochkaServer

type MatriochkaServer struct {
	Url       string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`             // Server Url
	PublicKey string `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` // Server Public Key
	Uuid      string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"`           // Optional, uuid for delivery confirmation
	Delay     int32  `protobuf:"varint,4,opt,name=delay,proto3" json:"delay,omitempty"`        // Max delay requested for message forwarding or delivery tracking
	// contains filtered or unexported fields
}

func (*MatriochkaServer) Descriptor deprecated

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

Deprecated: Use MatriochkaServer.ProtoReflect.Descriptor instead.

func (*MatriochkaServer) GetDelay

func (x *MatriochkaServer) GetDelay() int32

func (*MatriochkaServer) GetPublicKey

func (x *MatriochkaServer) GetPublicKey() string

func (*MatriochkaServer) GetUrl

func (x *MatriochkaServer) GetUrl() string

func (*MatriochkaServer) GetUuid

func (x *MatriochkaServer) GetUuid() string

func (*MatriochkaServer) ProtoMessage

func (*MatriochkaServer) ProtoMessage()

func (*MatriochkaServer) ProtoReflect

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

func (*MatriochkaServer) Reset

func (x *MatriochkaServer) Reset()

func (*MatriochkaServer) String

func (x *MatriochkaServer) String() string

type Meet

type Meet struct {
	PublicStatus string       `protobuf:"bytes,1,opt,name=public_status,json=publicStatus,proto3" json:"public_status,omitempty"` // Publish my online status, if the server is a meeting server
	ContactCard  *ContactCard `protobuf:"bytes,2,opt,name=contact_card,json=contactCard,proto3" json:"contact_card,omitempty"`    // mine or the requester
	Message      string       `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`                               // short description
	// contains filtered or unexported fields
}

func (*Meet) Descriptor deprecated

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

Deprecated: Use Meet.ProtoReflect.Descriptor instead.

func (*Meet) GetContactCard

func (x *Meet) GetContactCard() *ContactCard

func (*Meet) GetMessage

func (x *Meet) GetMessage() string

func (*Meet) GetPublicStatus

func (x *Meet) GetPublicStatus() string

func (*Meet) ProtoMessage

func (*Meet) ProtoMessage()

func (*Meet) ProtoReflect

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

func (*Meet) Reset

func (x *Meet) Reset()

func (*Meet) String

func (x *Meet) String() string

type PackedServerMessage

type PackedServerMessage struct {
	From      string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`           // The client public key for that server to get an answer
	Payload   []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`     // The ToServerMessage encrypted with the server public key |or| symetrical encryption as agreed earlier
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // The message signature with the client public key |eo| the reference to teh symetrical key used
	// contains filtered or unexported fields
}

structure definnig a message as received by a server in protobuf format

func (*PackedServerMessage) Descriptor deprecated

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

Deprecated: Use PackedServerMessage.ProtoReflect.Descriptor instead.

func (*PackedServerMessage) GetFrom

func (x *PackedServerMessage) GetFrom() string

func (*PackedServerMessage) GetPayload

func (x *PackedServerMessage) GetPayload() []byte

func (*PackedServerMessage) GetSignature

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

func (*PackedServerMessage) ProtoMessage

func (*PackedServerMessage) ProtoMessage()

func (*PackedServerMessage) ProtoReflect

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

func (*PackedServerMessage) Reset

func (x *PackedServerMessage) Reset()

func (*PackedServerMessage) String

func (x *PackedServerMessage) String() string

type PackedUserMessage

type PackedUserMessage struct {
	Destination     string  `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`                 // the peer's current conversation lookup public key
	Payload         []byte  `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`                         // the message UserMessage encrypted with the destination peer's public key
	Signature       []byte  `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`                     // the payload signature with the client identity private key
	ServerTimestamp []int64 `protobuf:"varint,4,rep,packed,name=serverTimestamp,proto3" json:"serverTimestamp,omitempty"` // server time stamp, might be several in matriochka mode
	// contains filtered or unexported fields
}

structure for sending a message to be forwarded to another user in protobuf format

func (*PackedUserMessage) Descriptor deprecated

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

Deprecated: Use PackedUserMessage.ProtoReflect.Descriptor instead.

func (*PackedUserMessage) GetDestination

func (x *PackedUserMessage) GetDestination() string

func (*PackedUserMessage) GetPayload

func (x *PackedUserMessage) GetPayload() []byte

func (*PackedUserMessage) GetServerTimestamp

func (x *PackedUserMessage) GetServerTimestamp() []int64

func (*PackedUserMessage) GetSignature

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

func (*PackedUserMessage) ProtoMessage

func (*PackedUserMessage) ProtoMessage()

func (*PackedUserMessage) ProtoReflect

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

func (*PackedUserMessage) Reset

func (x *PackedUserMessage) Reset()

func (*PackedUserMessage) String

func (x *PackedUserMessage) String() string

type ServerCard

type ServerCard struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                            // friendly server name
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`              // description : owner type (company/private/university...),
	PublicKey   string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // public key you must use to send encrypted messages to that server
	Url         string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`                              // meow server url
	Login       string `protobuf:"bytes,5,opt,name=login,proto3" json:"login,omitempty"`                          // required login to access the server
	Password    string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`                    // password associated to the login
	Signature   string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"`                  // signature of all previous fields by the server itself
	// contains filtered or unexported fields
}

structure describing required server attributes

func ServerFromUrl

func ServerFromUrl(url string) *ServerCard

func (*ServerCard) Descriptor deprecated

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

Deprecated: Use ServerCard.ProtoReflect.Descriptor instead.

func (*ServerCard) GetDescription

func (x *ServerCard) GetDescription() string

func (*ServerCard) GetLogin

func (x *ServerCard) GetLogin() string

func (*ServerCard) GetName

func (x *ServerCard) GetName() string

func (*ServerCard) GetPassword

func (x *ServerCard) GetPassword() string

func (*ServerCard) GetPublicKey

func (x *ServerCard) GetPublicKey() string

func (*ServerCard) GetSignature

func (x *ServerCard) GetSignature() string

func (*ServerCard) GetUid

func (sc *ServerCard) GetUid() string

func (*ServerCard) GetUrl

func (x *ServerCard) GetUrl() string

func (*ServerCard) IsSame

func (sc *ServerCard) IsSame(sc1 *ServerCard) bool

func (*ServerCard) ProtoMessage

func (*ServerCard) ProtoMessage()

func (*ServerCard) ProtoReflect

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

func (*ServerCard) Reset

func (x *ServerCard) Reset()

func (*ServerCard) String

func (x *ServerCard) String() string

type ToServerMessage

type ToServerMessage struct {
	Type              string                 `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`       // Type 1 : final destination / 2 : forward
	From              string                 `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`       // My pub key for the server to send me an encrypter answer
	Payload           []byte                 `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // optional payload for server
	PullRequest       []*ConversationRequest `protobuf:"bytes,4,rep,name=pull_request,json=pullRequest,proto3" json:"pull_request,omitempty"`
	Messages          []*PackedUserMessage   `protobuf:"bytes,5,rep,name=messages,proto3" json:"messages,omitempty"`
	KnownServers      []*ServerCard          `protobuf:"bytes,6,rep,name=known_servers,json=knownServers,proto3" json:"known_servers,omitempty"`
	MatriochkaMessage *Matriochka            `protobuf:"bytes,7,opt,name=matriochka_message,json=matriochkaMessage,proto3" json:"matriochka_message,omitempty"`
	Uuid              string                 `protobuf:"bytes,8,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Invitation        *Invitation            `protobuf:"bytes,9,opt,name=invitation,proto3" json:"invitation,omitempty"`                                // invitation for the 2 first steps of a "through server" invitation process
	DeviceMessages    []*PackedUserMessage   `protobuf:"bytes,10,rep,name=device_messages,json=deviceMessages,proto3" json:"device_messages,omitempty"` // messages to another device belonging to the same user
	Timeout           int64                  `protobuf:"varint,11,opt,name=timeout,proto3" json:"timeout,omitempty"`                                    // timeout expected by the client for the server to answer (long polling)
	// contains filtered or unexported fields
}

structure defining a message for a server, that will be encrypted, then sent in a "packedmessage" payload

func (*ToServerMessage) Descriptor deprecated

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

Deprecated: Use ToServerMessage.ProtoReflect.Descriptor instead.

func (*ToServerMessage) GetDeviceMessages

func (x *ToServerMessage) GetDeviceMessages() []*PackedUserMessage

func (*ToServerMessage) GetFrom

func (x *ToServerMessage) GetFrom() string

func (*ToServerMessage) GetInvitation

func (x *ToServerMessage) GetInvitation() *Invitation

func (*ToServerMessage) GetKnownServers

func (x *ToServerMessage) GetKnownServers() []*ServerCard

func (*ToServerMessage) GetMatriochkaMessage

func (x *ToServerMessage) GetMatriochkaMessage() *Matriochka

func (*ToServerMessage) GetMessages

func (x *ToServerMessage) GetMessages() []*PackedUserMessage

func (*ToServerMessage) GetPayload

func (x *ToServerMessage) GetPayload() []byte

func (*ToServerMessage) GetPullRequest

func (x *ToServerMessage) GetPullRequest() []*ConversationRequest

func (*ToServerMessage) GetTimeout

func (x *ToServerMessage) GetTimeout() int64

func (*ToServerMessage) GetType

func (x *ToServerMessage) GetType() string

func (*ToServerMessage) GetUuid

func (x *ToServerMessage) GetUuid() string

func (*ToServerMessage) ProtoMessage

func (*ToServerMessage) ProtoMessage()

func (*ToServerMessage) ProtoReflect

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

func (*ToServerMessage) Reset

func (x *ToServerMessage) Reset()

func (*ToServerMessage) String

func (x *ToServerMessage) String() string

type UserMessage

type UserMessage struct {
	Destination     string              `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` // Lookupkey
	From            string              `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`               // My public key for that contact
	Type            string              `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`               // Message type
	Data            []byte              `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	Status          *ConversationStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	Contact         *ContactCard        `protobuf:"bytes,6,opt,name=contact,proto3" json:"contact,omitempty"`
	KnownServers    *ServerCard         `protobuf:"bytes,7,opt,name=knownServers,proto3" json:"knownServers,omitempty"`
	Group           *Group              `protobuf:"bytes,8,opt,name=group,proto3" json:"group,omitempty"`
	Files           []*File             `protobuf:"bytes,9,rep,name=files,proto3" json:"files,omitempty"`
	CurrentLocation *Location           `protobuf:"bytes,10,opt,name=currentLocation,proto3" json:"currentLocation,omitempty"`
	Appdata         []byte              `protobuf:"bytes,11,opt,name=appdata,proto3" json:"appdata,omitempty"`
	Invitation      *Invitation         `protobuf:"bytes,12,opt,name=invitation,proto3" json:"invitation,omitempty"`
	// contains filtered or unexported fields
}

structure defining information that might be exchanged between two peers.

func (*UserMessage) AddFile

func (msg *UserMessage) AddFile(filename string, maxMessageSize int64) error

func (*UserMessage) Descriptor deprecated

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

Deprecated: Use UserMessage.ProtoReflect.Descriptor instead.

func (*UserMessage) GetAppdata

func (x *UserMessage) GetAppdata() []byte

func (*UserMessage) GetContact

func (x *UserMessage) GetContact() *ContactCard

func (*UserMessage) GetCurrentLocation

func (x *UserMessage) GetCurrentLocation() *Location

func (*UserMessage) GetData

func (x *UserMessage) GetData() []byte

func (*UserMessage) GetDestination

func (x *UserMessage) GetDestination() string

func (*UserMessage) GetFiles

func (x *UserMessage) GetFiles() []*File

func (*UserMessage) GetFrom

func (x *UserMessage) GetFrom() string

func (*UserMessage) GetGroup

func (x *UserMessage) GetGroup() *Group

func (*UserMessage) GetInvitation

func (x *UserMessage) GetInvitation() *Invitation

func (*UserMessage) GetKnownServers

func (x *UserMessage) GetKnownServers() *ServerCard

func (*UserMessage) GetStatus

func (x *UserMessage) GetStatus() *ConversationStatus

func (*UserMessage) GetType

func (x *UserMessage) GetType() string

func (*UserMessage) ProtoMessage

func (*UserMessage) ProtoMessage()

func (*UserMessage) ProtoReflect

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

func (*UserMessage) Reset

func (x *UserMessage) Reset()

func (*UserMessage) String

func (x *UserMessage) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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