Documentation ¶
Index ¶
- Variables
- type Group
- func (group *Group) MergeInAdminsEvent(evt *nostr.Event) error
- func (group *Group) MergeInMembersEvent(evt *nostr.Event) error
- func (group *Group) MergeInMetadataEvent(evt *nostr.Event) error
- func (group Group) ToAdminsEvent() *nostr.Event
- func (group Group) ToMembersEvent() *nostr.Event
- func (group Group) ToMetadataEvent() *nostr.Event
- type GroupAddress
- type KindRange
- type Permission
- type Role
Constants ¶
This section is empty.
Variables ¶
View Source
var MetadataEventKinds = KindRange{
nostr.KindSimpleGroupMetadata,
nostr.KindSimpleGroupAdmins,
nostr.KindSimpleGroupMembers,
}
View Source
var ModerationEventKinds = KindRange{
nostr.KindSimpleGroupAddUser,
nostr.KindSimpleGroupRemoveUser,
nostr.KindSimpleGroupEditMetadata,
nostr.KindSimpleGroupAddPermission,
nostr.KindSimpleGroupRemovePermission,
nostr.KindSimpleGroupDeleteEvent,
nostr.KindSimpleGroupEditGroupStatus,
nostr.KindSimpleGroupCreateGroup,
nostr.KindSimpleGroupDeleteGroup,
}
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { Address GroupAddress Name string Picture string About string Members map[string]*Role Private bool Closed bool LastMetadataUpdate nostr.Timestamp LastAdminsUpdate nostr.Timestamp LastMembersUpdate nostr.Timestamp }
func NewGroupFromMetadataEvent ¶ added in v0.33.0
func (*Group) MergeInAdminsEvent ¶
func (*Group) MergeInMembersEvent ¶
func (*Group) MergeInMetadataEvent ¶
func (Group) ToAdminsEvent ¶
func (group Group) ToAdminsEvent() *nostr.Event
func (Group) ToMembersEvent ¶
func (group Group) ToMembersEvent() *nostr.Event
func (Group) ToMetadataEvent ¶
func (group Group) ToMetadataEvent() *nostr.Event
type GroupAddress ¶ added in v0.31.0
func ParseGroupAddress ¶ added in v0.31.0
func ParseGroupAddress(raw string) (GroupAddress, error)
func (GroupAddress) Equals ¶ added in v0.31.0
func (gid GroupAddress) Equals(gid2 GroupAddress) bool
func (GroupAddress) IsValid ¶ added in v0.31.0
func (gid GroupAddress) IsValid() bool
func (GroupAddress) String ¶ added in v0.31.0
func (gid GroupAddress) String() string
type Permission ¶
type Permission string
const ( PermAddUser Permission = "add-user" PermEditMetadata Permission = "edit-metadata" PermDeleteEvent Permission = "delete-event" PermRemoveUser Permission = "remove-user" PermAddPermission Permission = "add-permission" PermRemovePermission Permission = "remove-permission" PermEditGroupStatus Permission = "edit-group-status" PermDeleteGroup Permission = "delete-group" )
type Role ¶
type Role struct { Name string Permissions map[Permission]struct{} }
var ( // used for normal members without admin powers EmptyRole *Role = nil PermissionsMap = map[Permission]struct{}{ PermAddUser: {}, PermEditMetadata: {}, PermDeleteEvent: {}, PermRemoveUser: {}, PermAddPermission: {}, PermRemovePermission: {}, PermEditGroupStatus: {}, } )
Click to show internal directories.
Click to hide internal directories.