Versions in this module Expand all Collapse all v0 v0.1.0 Jan 10, 2026 Changes in this version + const CompressionGzip + const CompressionNone + const CompressionZstd + const FormatV1 + const FormatV2 + func EncryptV2(msg *Message, password string) ([]byte, error) + func EncryptV2WithManifest(msg *Message, password string, manifest *Manifest) ([]byte, error) + func EncryptV2WithOptions(msg *Message, password string, manifest *Manifest, compression string) ([]byte, error) + func EncryptWithManifest(msg *Message, password string, manifest *Manifest) ([]byte, error) + func EncryptWithManifestBase64(msg *Message, password string, manifest *Manifest) (string, error) type Header + Compression string + Format string + Manifest *Manifest + type Manifest struct + Album string + Artist string + Duration int + ExpiresAt int64 + Extra map[string]string + Format string + Genre string + IssuedAt int64 + LicenseType string + Links map[string]string + ReleaseType string + Tags []string + Title string + Tracks []Track + Year int + func NewManifest(title string) *Manifest + func (m *Manifest) AddLink(platform, url string) *Manifest + func (m *Manifest) AddTrack(title string, start float64) *Manifest + func (m *Manifest) AddTrackFull(title string, start, end float64, trackType string) *Manifest + func (m *Manifest) IsExpired() bool + func (m *Manifest) TimeRemaining() int64 + func (m *Manifest) WithExpiration(expiresAt int64) *Manifest + func (m *Manifest) WithPreviewAccess(seconds int) *Manifest + func (m *Manifest) WithRentalDuration(durationSeconds int64) *Manifest + func (m *Manifest) WithStreamingAccess(hours int) *Manifest type Message + func (m *Message) AddBinaryAttachment(name string, data []byte, mimeType string) *Message + type Track struct + End float64 + Start float64 + Title string + TrackNum int + Type string v0.0.2 Dec 27, 2025 Changes in this version + const Magic + const Version + var ErrDecryptionFailed = errors.New("decryption failed (wrong password?)") + var ErrEmptyMessage = errors.New("message cannot be empty") + var ErrInvalidMagic = errors.New("invalid SMSG magic") + var ErrInvalidPayload = errors.New("invalid SMSG payload") + var ErrPasswordRequired = errors.New("password is required") + func DeriveKey(password string) []byte + func Encrypt(msg *Message, password string) ([]byte, error) + func EncryptBase64(msg *Message, password string) (string, error) + func EncryptWithHint(msg *Message, password, hint string) ([]byte, error) + func QuickDecrypt(encoded, password string) (string, error) + func QuickEncrypt(body, password string) (string, error) + func Validate(data []byte) error + type Attachment struct + Content string + MimeType string + Name string + Size int + type Header struct + Algorithm string + Hint string + Version string + func GetInfo(data []byte) (*Header, error) + func GetInfoBase64(encoded string) (*Header, error) + type Message struct + Attachments []Attachment + Body string + From string + Meta map[string]string + ReplyKey *PKIInfo + Subject string + Timestamp int64 + func Decrypt(data []byte, password string) (*Message, error) + func DecryptBase64(encoded, password string) (*Message, error) + func NewMessage(body string) *Message + func (m *Message) AddAttachment(name, content, mimeType string) *Message + func (m *Message) GetAttachment(name string) *Attachment + func (m *Message) SetMeta(key, value string) *Message + func (m *Message) WithFrom(from string) *Message + func (m *Message) WithReplyKey(publicKeyB64 string) *Message + func (m *Message) WithReplyKeyInfo(pki *PKIInfo) *Message + func (m *Message) WithSubject(subject string) *Message + func (m *Message) WithTimestamp(ts int64) *Message + type PKIInfo struct + Algorithm string + Fingerprint string + KeyID string + PublicKey string