Documentation
¶
Index ¶
- Constants
- type CredentialWithKey
- type Group
- type GroupUpdateInfo
- type KeyPackage
- type MemoryStore
- type NostrMLS
- func (n *NostrMLS) ClearStore() error
- func (n *NostrMLS) CreateKeyPackageHex(pubkey string) (string, error)
- func (n *NostrMLS) CreateMessage(groupID []byte, message string) (string, error)
- func (n *NostrMLS) ExporterSecretWithEpoch(groupID []byte) (string, uint64, error)
- func (n *NostrMLS) NewGroup(name, description, creator string, memberKeyPackages []KeyPackage, ...) (*Group, error)
- func (n *NostrMLS) ParseKeyPackage(keyPackageHex string) (*KeyPackage, error)
- func (n *NostrMLS) ParseSerializedEventFromGroupMessage(groupID []byte, message string) ([]byte, error)
- func (n *NostrMLS) PreviewWelcome(welcomeMessage []byte) (*WelcomePreview, error)
- type Store
- type Welcome
- type WelcomePreview
Constants ¶
View Source
const ( KindMLSKeyPackage = 443 KindMLSWelcome = 444 KindMLSGroupMessage = 445 KindMLSKeyPackageRelayList = 10051 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialWithKey ¶
type CredentialWithKey struct { Credential *mls.Credential SignaturePublicKey []byte }
type Group ¶
type Group struct { WelcomeMessage []byte NostrGroupData *extension.NostrGroupData // contains filtered or unexported fields }
type GroupUpdateInfo ¶
type KeyPackage ¶
type KeyPackage mls.KeyPackage
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is used for tests
func (*MemoryStore) Clear ¶
func (s *MemoryStore) Clear() error
func (*MemoryStore) Remove ¶
func (s *MemoryStore) Remove(key []byte) error
func (*MemoryStore) Upsert ¶
func (s *MemoryStore) Upsert(key, value []byte) error
type NostrMLS ¶
type NostrMLS struct {
// contains filtered or unexported fields
}
func NewNostrMLS ¶
func (*NostrMLS) ClearStore ¶
func (*NostrMLS) CreateKeyPackageHex ¶
func (*NostrMLS) CreateMessage ¶
func (*NostrMLS) ExporterSecretWithEpoch ¶
func (*NostrMLS) NewGroup ¶
func (n *NostrMLS) NewGroup(name, description, creator string, memberKeyPackages []KeyPackage, admins, relays []string) (*Group, error)
creator: pubkey admins: list of pubkeys
func (*NostrMLS) ParseKeyPackage ¶
func (n *NostrMLS) ParseKeyPackage(keyPackageHex string) (*KeyPackage, error)
func (*NostrMLS) ParseSerializedEventFromGroupMessage ¶
func (*NostrMLS) PreviewWelcome ¶
func (n *NostrMLS) PreviewWelcome(welcomeMessage []byte) (*WelcomePreview, error)
type Store ¶
type Store interface { // Upsert updates or inserts an entry Upsert(key, value []byte) error // Get gets an entry Get(key []byte) ([]byte, error) // Remove removes an entry Remove(key []byte) error // Clear clears entire store Clear() error }
Store is used for NostrMLS
func NewMemoryStore ¶
func NewMemoryStore() Store
type WelcomePreview ¶
type WelcomePreview struct { Welcome *Welcome NostrGroupData *extension.NostrGroupData }
func (*WelcomePreview) Join ¶
func (p *WelcomePreview) Join() (*Group, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.