Documentation
¶
Index ¶
- Constants
- Variables
- func EmbeddedLiveKitAvailable() bool
- func EmbeddedLiveKitError() string
- func EmbeddedLiveKitRunning() bool
- func Init(relay *khatru.Relay)
- func LiveKitProxyHandler(w http.ResponseWriter, r *http.Request)
- func ShutdownEmbeddedLiveKit()
- func StartEmbeddedLiveKit() error
- func StopEmbeddedLiveKit() error
- type Group
- type GroupsState
- func (s *GroupsState) GetGroupFromEvent(event nostr.Event) *Group
- func (s *GroupsState) HandleEventSaved(event nostr.Event)
- func (s *GroupsState) NewGroup(id string) *Group
- func (s *GroupsState) ProcessEvent(ctx context.Context, event nostr.Event) (groupsAffected []*Group)
- func (s *GroupsState) Query(ctx context.Context, filter nostr.Filter) iter.Seq[nostr.Event]
- func (s *GroupsState) RejectEvent(ctx context.Context, event nostr.Event) (reject bool, msg string)
- func (s *GroupsState) RequestAuthWhenNecessary(ctx context.Context, filter nostr.Filter) (reject bool, msg string)
- func (s *GroupsState) ShouldPreventBroadcast(evt nostr.Event, filter nostr.Filter, authed []nostr.PubKey) bool
- func (s *GroupsState) SyncGroupMetadataEvents(group *Group) iter.Seq2[nostr.Event, error]
- func (s *GroupsState) WipeGroup(groupId string) error
- type MuxHandler
- type Options
- type TokenSourceResponse
Constants ¶
View Source
const ( PRIMARY_ROLE_NAME = "admin" SECONDARY_ROLE_NAME = "moderator" )
Variables ¶
View Source
var LiveKitEmbedded bool
Functions ¶
func EmbeddedLiveKitAvailable ¶ added in v1.1.0
func EmbeddedLiveKitAvailable() bool
func EmbeddedLiveKitError ¶ added in v1.1.0
func EmbeddedLiveKitError() string
func EmbeddedLiveKitRunning ¶ added in v1.1.0
func EmbeddedLiveKitRunning() bool
func LiveKitProxyHandler ¶ added in v1.1.0
func LiveKitProxyHandler(w http.ResponseWriter, r *http.Request)
func ShutdownEmbeddedLiveKit ¶ added in v1.1.0
func ShutdownEmbeddedLiveKit()
func StartEmbeddedLiveKit ¶ added in v1.1.0
func StartEmbeddedLiveKit() error
func StopEmbeddedLiveKit ¶ added in v1.1.0
func StopEmbeddedLiveKit() error
Types ¶
type Group ¶
func (*Group) AnyOfTheseIsAMember ¶
type GroupsState ¶
type GroupsState struct {
Groups *xsync.MapOf[string, *Group]
DB eventstore.Store
// contains filtered or unexported fields
}
var ( Handler = &MuxHandler{} State *GroupsState )
func NewGroupsState ¶
func NewGroupsState(opts Options) *GroupsState
func (*GroupsState) GetGroupFromEvent ¶
func (s *GroupsState) GetGroupFromEvent(event nostr.Event) *Group
func (*GroupsState) HandleEventSaved ¶ added in v1.0.20
func (s *GroupsState) HandleEventSaved(event nostr.Event)
func (*GroupsState) NewGroup ¶
func (s *GroupsState) NewGroup(id string) *Group
NewGroup creates a new group from scratch (but doesn't store it in the groups map)
func (*GroupsState) ProcessEvent ¶
func (*GroupsState) RejectEvent ¶
func (*GroupsState) RequestAuthWhenNecessary ¶
func (*GroupsState) ShouldPreventBroadcast ¶ added in v1.0.20
func (*GroupsState) SyncGroupMetadataEvents ¶ added in v1.0.20
SyncGroupMetadataEvents tries to save new versions of metadata events to the database. if they are new enough (<3s) they are returned in the iterator, otherwise not.
func (*GroupsState) WipeGroup ¶ added in v1.0.9
func (s *GroupsState) WipeGroup(groupId string) error
type MuxHandler ¶ added in v1.0.4
type MuxHandler struct {
// contains filtered or unexported fields
}
func (*MuxHandler) ServeHTTP ¶ added in v1.0.4
func (mh *MuxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TokenSourceResponse ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.