Documentation
¶
Index ¶
- func ViewerRole(state *sobject.SOState, peerID string) sobject.SOParticipantRole
- type MailboxEntry
- type ParticipantInfo
- type ParticipantPresentation
- type SharingState
- type State
- func (s *State) BridgeSOState(ctx context.Context, soStateCtr ccontainer.Watchable[*sobject.SOState])
- func (s *State) RunWatchLoop(ctx context.Context, peerID string, send func(*SharingState) error) error
- func (s *State) SetMailboxEntries(entries []*MailboxEntry)
- func (s *State) SetSOState(next *sobject.SOState)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ViewerRole ¶
func ViewerRole(state *sobject.SOState, peerID string) sobject.SOParticipantRole
ViewerRole returns the current viewer's effective participant role.
Types ¶
type MailboxEntry ¶
type MailboxEntry struct {
ID int64
InviteID string
PeerID string
Status string
CreatedAt int64
AccountID string
EntityID string
}
MailboxEntry contains mailbox metadata needed by sharing state projection.
type ParticipantInfo ¶
type ParticipantInfo struct {
AccountID string
EntityID string
PeerIDs []string
Role sobject.SOParticipantRole
IsSelf bool
}
ParticipantInfo is the app-facing participant presentation row.
func BuildParticipantInfo ¶
func BuildParticipantInfo( soState *sobject.SOState, selfPeerID string, presentation *ParticipantPresentation, ) []*ParticipantInfo
BuildParticipantInfo groups participant rows by account or peer identity.
type ParticipantPresentation ¶
type ParticipantPresentation struct {
SelfAccountID string
SelfEntityID string
AccountLabels map[string]string
}
ParticipantPresentation contains account labels used by sharing rows.
type SharingState ¶
type SharingState struct {
Participants []*sobject.SOParticipantConfig
Invites []*sobject.SOInvite
MailboxEntries []*MailboxEntry
ViewerRole sobject.SOParticipantRole
CanManage bool
ParticipantInfo []*ParticipantInfo
}
SharingState contains the sharing snapshot for a space.
func (*SharingState) Equal ¶
func (s *SharingState) Equal(that *SharingState) bool
Equal reports whether two sharing snapshots contain the same projected values.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State carries every input snapshot the sharing watch reads per emission.
func NewState ¶
func NewState( soState *sobject.SOState, mailboxEntries []*MailboxEntry, presentation *ParticipantPresentation, ) *State
NewState returns a sharing watch state owner.
func (*State) BridgeSOState ¶
func (s *State) BridgeSOState( ctx context.Context, soStateCtr ccontainer.Watchable[*sobject.SOState], )
BridgeSOState forwards SO state container updates into the local broadcast.
func (*State) RunWatchLoop ¶
func (s *State) RunWatchLoop( ctx context.Context, peerID string, send func(*SharingState) error, ) error
RunWatchLoop emits a fresh SpaceSharingState whenever any folded source changes.
func (*State) SetMailboxEntries ¶
func (s *State) SetMailboxEntries(entries []*MailboxEntry)
SetMailboxEntries updates mailbox entries and wakes watchers.
func (*State) SetSOState ¶
SetSOState updates the shared object state snapshot and wakes watchers.