Documentation ¶
Index ¶
- Variables
- func GetGroupIDFromEvent(event *nostr.Event) string
- type Action
- type AddPermission
- type AddUser
- type CreateGroup
- type DeleteEvent
- type EditGroupStatus
- type EditMetadata
- type Group
- type Options
- type RemovePermission
- type RemoveUser
- type State
- func (s *State) AdminsQueryHandler(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
- func (s *State) ApplyModerationAction(ctx context.Context, event *nostr.Event)
- func (s *State) GetGroupFromEvent(event *nostr.Event) *Group
- func (s *State) MembersQueryHandler(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
- func (s *State) MetadataQueryHandler(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
- func (s *State) NewGroup(id string) *Group
- func (s *State) NormalEventQuery(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
- func (s *State) PreventWritingOfEventsJustDeleted(ctx context.Context, event *nostr.Event) (reject bool, msg string)
- func (s *State) ReactToJoinRequest(ctx context.Context, event *nostr.Event)
- func (s *State) RequireHTagForExistingGroup(ctx context.Context, event *nostr.Event) (reject bool, msg string)
- func (s *State) RequireKindAndSingleGroupIDOrSpecificEventReference(ctx context.Context, filter nostr.Filter) (reject bool, msg string)
- func (s *State) RequireModerationEventsToBeRecent(ctx context.Context, event *nostr.Event) (reject bool, msg string)
- func (s *State) RestrictInvalidModerationActions(ctx context.Context, event *nostr.Event) (reject bool, msg string)
- func (s *State) RestrictWritesBasedOnGroupRules(ctx context.Context, event *nostr.Event) (reject bool, msg string)
Constants ¶
This section is empty.
Variables ¶
View Source
var PTagNotValidPublicKey = fmt.Errorf("'p' tag value is not a valid public key")
Functions ¶
func GetGroupIDFromEvent ¶
func GetGroupIDFromEvent(event *nostr.Event) string
Types ¶
type Action ¶
type Action interface { Apply(group *nip29.Group) PermissionName() nip29.Permission }
func PrepareModerationAction ¶
type AddPermission ¶
type AddPermission struct { Initiator string // the user who is adding the permissions Targets []string Permissions []nip29.Permission When nostr.Timestamp }
func (AddPermission) Apply ¶
func (a AddPermission) Apply(group *nip29.Group)
func (AddPermission) PermissionName ¶
func (AddPermission) PermissionName() nip29.Permission
type AddUser ¶
type AddUser struct { Targets []string When nostr.Timestamp }
func (AddUser) PermissionName ¶
func (AddUser) PermissionName() nip29.Permission
type CreateGroup ¶
type CreateGroup struct { Creator string When nostr.Timestamp }
func (CreateGroup) Apply ¶
func (a CreateGroup) Apply(group *nip29.Group)
func (CreateGroup) PermissionName ¶
func (CreateGroup) PermissionName() nip29.Permission
type DeleteEvent ¶
type DeleteEvent struct {
Targets []string
}
func (DeleteEvent) Apply ¶
func (a DeleteEvent) Apply(group *nip29.Group)
func (DeleteEvent) PermissionName ¶
func (DeleteEvent) PermissionName() nip29.Permission
type EditGroupStatus ¶
func (EditGroupStatus) Apply ¶
func (a EditGroupStatus) Apply(group *nip29.Group)
func (EditGroupStatus) PermissionName ¶
func (EditGroupStatus) PermissionName() nip29.Permission
type EditMetadata ¶
type EditMetadata struct { NameValue string PictureValue string AboutValue string When nostr.Timestamp }
func (EditMetadata) Apply ¶
func (a EditMetadata) Apply(group *nip29.Group)
func (EditMetadata) PermissionName ¶
func (EditMetadata) PermissionName() nip29.Permission
type RemovePermission ¶
type RemovePermission struct { Targets []string Permissions []nip29.Permission When nostr.Timestamp }
func (RemovePermission) Apply ¶
func (a RemovePermission) Apply(group *nip29.Group)
func (RemovePermission) PermissionName ¶
func (RemovePermission) PermissionName() nip29.Permission
type RemoveUser ¶
type RemoveUser struct { Targets []string When nostr.Timestamp }
func (RemoveUser) Apply ¶
func (a RemoveUser) Apply(group *nip29.Group)
func (RemoveUser) PermissionName ¶
func (RemoveUser) PermissionName() nip29.Permission
type State ¶
type State struct { Domain string Groups *xsync.MapOf[string, *Group] DB eventstore.Store Relay interface { BroadcastEvent(*nostr.Event) AddEvent(context.Context, *nostr.Event) (skipBroadcast bool, writeError error) } GetAuthed func(context.Context) string AllowPrivateGroups bool // contains filtered or unexported fields }
func (*State) AdminsQueryHandler ¶
func (*State) ApplyModerationAction ¶
func (*State) GetGroupFromEvent ¶
func (*State) MembersQueryHandler ¶
func (*State) MetadataQueryHandler ¶
func (*State) NormalEventQuery ¶
func (*State) PreventWritingOfEventsJustDeleted ¶
func (*State) ReactToJoinRequest ¶
func (*State) RequireHTagForExistingGroup ¶
func (*State) RequireKindAndSingleGroupIDOrSpecificEventReference ¶
func (*State) RequireModerationEventsToBeRecent ¶
func (*State) RestrictInvalidModerationActions ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.