nip29

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetadataEventKinds = KindRange{
	nostr.KindSimpleGroupMetadata,
	nostr.KindSimpleGroupAdmins,
	nostr.KindSimpleGroupMembers,
	nostr.KindSimpleGroupRoles,
}
View Source
var ModerationEventKinds = KindRange{
	nostr.KindSimpleGroupPutUser,
	nostr.KindSimpleGroupRemoveUser,
	nostr.KindSimpleGroupEditMetadata,
	nostr.KindSimpleGroupDeleteEvent,
	nostr.KindSimpleGroupCreateGroup,
	nostr.KindSimpleGroupDeleteGroup,
	nostr.KindSimpleGroupCreateInvite,
}

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

	Roles []*Role

	LastMetadataUpdate nostr.Timestamp
	LastAdminsUpdate   nostr.Timestamp
	LastMembersUpdate  nostr.Timestamp
	LastRolesUpdate    nostr.Timestamp
}

func NewGroup

func NewGroup(gadstr string) (Group, error)

NewGroup takes a group address in the form "<id>'<relay-hostname>"

func NewGroupFromMetadataEvent added in v0.33.0

func NewGroupFromMetadataEvent(relayURL string, evt *nostr.Event) (Group, error)

func (Group) GetRoleByName added in v0.42.1

func (group Group) GetRoleByName(name string) *Role

func (*Group) MergeInAdminsEvent

func (group *Group) MergeInAdminsEvent(evt *nostr.Event) error

func (*Group) MergeInMembersEvent

func (group *Group) MergeInMembersEvent(evt *nostr.Event) error

func (*Group) MergeInMetadataEvent

func (group *Group) MergeInMetadataEvent(evt *nostr.Event) error

func (Group) String added in v0.42.1

func (group Group) String() string

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

func (Group) ToRolesEvent added in v0.42.1

func (group Group) ToRolesEvent() *nostr.Event

type GroupAddress added in v0.31.0

type GroupAddress struct {
	Relay string
	ID    string
}

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 KindRange

type KindRange []int

func (KindRange) Includes

func (kr KindRange) Includes(kind int) bool

type Role

type Role struct {
	Name        string
	Description string
}

Jump to

Keyboard shortcuts

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