Documentation ¶
Index ¶
- Variables
- func GetGroupIDFromEvent(event *nostr.Event) string
- func IsInternalCall(ctx context.Context) bool
- type Action
- type CreateGroup
- type DeleteEvent
- type DeleteGroup
- type EditMetadata
- type Group
- type Options
- type PubKeyRoles
- type PutUser
- 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) CreateGroup(ctx context.Context, groupId string, creator string, defs EditMetadata) error
- func (s *State) DeleteEvent(ctx context.Context, groupId string, eventId string) error
- 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, creator 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) PutUser(ctx context.Context, groupId string, pubkey string, roles ...string) error
- func (s *State) ReactToJoinRequest(ctx context.Context, event *nostr.Event)
- func (s *State) ReactToLeaveRequest(ctx context.Context, event *nostr.Event)
- func (s *State) RemoveUserFromGroup(ctx context.Context, groupId string, pubkey string) error
- 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)
- func (s *State) RolesQueryHandler(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)
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
func IsInternalCall ¶ added in v0.5.0
Types ¶
type Action ¶ added in v0.4.0
func PrepareModerationAction ¶ added in v0.4.0
type CreateGroup ¶ added in v0.4.0
type CreateGroup struct { Creator string When nostr.Timestamp }
func (CreateGroup) Apply ¶ added in v0.4.0
func (a CreateGroup) Apply(group *nip29.Group)
func (CreateGroup) Name ¶ added in v0.5.0
func (_ CreateGroup) Name() string
type DeleteEvent ¶ added in v0.4.0
type DeleteEvent struct {
Targets []string
}
func (DeleteEvent) Apply ¶ added in v0.4.0
func (a DeleteEvent) Apply(group *nip29.Group)
func (DeleteEvent) Name ¶ added in v0.5.0
func (_ DeleteEvent) Name() string
type DeleteGroup ¶ added in v0.4.0
type DeleteGroup struct {
When nostr.Timestamp
}
func (DeleteGroup) Apply ¶ added in v0.4.0
func (a DeleteGroup) Apply(group *nip29.Group)
func (DeleteGroup) Name ¶ added in v0.5.0
func (_ DeleteGroup) Name() string
type EditMetadata ¶ added in v0.4.0
type EditMetadata struct { NameValue *string PictureValue *string AboutValue *string PrivateValue *bool ClosedValue *bool When nostr.Timestamp }
func (EditMetadata) Apply ¶ added in v0.4.0
func (a EditMetadata) Apply(group *nip29.Group)
func (EditMetadata) Name ¶ added in v0.5.0
func (_ EditMetadata) Name() string
type PubKeyRoles ¶ added in v0.5.0
type PutUser ¶ added in v0.5.0
type PutUser struct { Targets []PubKeyRoles When nostr.Timestamp }
type RemoveUser ¶ added in v0.4.0
type RemoveUser struct { Targets []string When nostr.Timestamp }
func (RemoveUser) Apply ¶ added in v0.4.0
func (a RemoveUser) Apply(group *nip29.Group)
func (RemoveUser) Name ¶ added in v0.5.0
func (_ RemoveUser) Name() string
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 AllowAction func(ctx context.Context, group nip29.Group, role *nip29.Role, action Action) bool // contains filtered or unexported fields }
func (*State) AdminsQueryHandler ¶ added in v0.3.0
func (*State) ApplyModerationAction ¶ added in v0.3.0
func (*State) CreateGroup ¶ added in v0.5.0
func (*State) DeleteEvent ¶ added in v0.5.0
func (*State) GetGroupFromEvent ¶
func (*State) MembersQueryHandler ¶ added in v0.3.0
func (*State) MetadataQueryHandler ¶ added in v0.3.0
func (*State) NewGroup ¶
NewGroup creates a new group from scratch (but doesn't store it in the groups map)
func (*State) NormalEventQuery ¶ added in v0.3.0
func (*State) PreventWritingOfEventsJustDeleted ¶ added in v0.3.0
func (*State) ReactToJoinRequest ¶ added in v0.3.0
func (*State) ReactToLeaveRequest ¶ added in v0.4.0
func (*State) RemoveUserFromGroup ¶ added in v0.5.0
func (*State) RequireHTagForExistingGroup ¶ added in v0.3.0
func (*State) RequireKindAndSingleGroupIDOrSpecificEventReference ¶ added in v0.3.0
func (*State) RequireModerationEventsToBeRecent ¶ added in v0.3.0
func (*State) RestrictInvalidModerationActions ¶ added in v0.3.0
func (*State) RestrictWritesBasedOnGroupRules ¶ added in v0.3.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.