Documentation ¶
Index ¶
- Constants
- func EncryptLink(link *messengertypes.BertyLink, passphrase []byte) (*messengertypes.BertyLink, error)
- func InternalLinkToMessage(accountID, groupPK, cid string) (string, error)
- func MarshalLink(link *messengertypes.BertyLink) (internal string, web string, err error)
- func UnmarshalLink(uri string, key []byte) (*messengertypes.BertyLink, error)
Constants ¶
const ( LinkWebPrefix = "https://berty.tech/id#" LinkInternalPrefix = "BERTY://" DefaultChecksumSize = 1 // 1-byte length by default (should have ~1/256 false-positive in case of invalid password) )
Variables ¶
This section is empty.
Functions ¶
func EncryptLink ¶ added in v2.231.0
func EncryptLink(link *messengertypes.BertyLink, passphrase []byte) (*messengertypes.BertyLink, error)
EncryptLink converts a clear BertyLink into an encrypted one.
The encrypted link can be marshaled by UnmarshalLink if a passphrase is provided in the URL.
func InternalLinkToMessage ¶ added in v2.305.0
func MarshalLink ¶
func MarshalLink(link *messengertypes.BertyLink) (internal string, web string, err error)
MarshalLink returns shareable web and internal URLs.
The web URL is meant to: - be short, - have some parts that are human-readable, - to point to a sub-page of the berty.tech website where some JS code will parse the human-readable part.
The internal URL is meant to generate the most tiny QR codes. These QR codes can only be opened by a Berty app.
Marshal will return an error if the provided link does not contain all the mandatory fields; it may also filter-out some sensitive data.
func UnmarshalLink ¶
func UnmarshalLink(uri string, key []byte) (*messengertypes.BertyLink, error)
UnmarshalLink takes an URL generated by BertyLink.Marshal (or manually crafted), and returns a BertyLink object.
Types ¶
This section is empty.