Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AncestorChain(channelID uint32) []uint32
- func (m *Manager) CleanEmptyTempChannels(hasUsers func(channelID uint32) bool)
- func (m *Manager) Create(parentID uint32, name string, description string, position int32, ...) *mumble.Channel
- func (m *Manager) GetChannel(id uint32) (*mumble.Channel, bool)
- func (m *Manager) GetChannelWithMeta(channelID uint32) (ch *mumble.Channel, inheritACL bool, ok bool)
- func (m *Manager) GetTree() []*mumble.Channel
- func (m *Manager) LinkedChannelIDs(channelID uint32) []uint32
- func (m *Manager) NextID() uint32
- func (m *Manager) Reload()
- func (m *Manager) Remove(id uint32) bool
- func (m *Manager) RootID() uint32
- func (m *Manager) ServerID() uint
- func (m *Manager) SubtreeIDs(id uint32) []uint32
- func (m *Manager) Update(id uint32, opts UpdateOpts) bool
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager maintains the channel tree state.
func NewManager ¶
NewManager creates a ChannelManager for a virtual server.
func (*Manager) AncestorChain ¶
AncestorChain returns channel IDs from the given channel up to root (inclusive). First element is the channel, last is root.
func (*Manager) CleanEmptyTempChannels ¶
CleanEmptyTempChannels removes temporary channels that have no users and no children. hasUsers returns true if the channel has any users.
func (*Manager) Create ¶
func (m *Manager) Create(parentID uint32, name string, description string, position int32, temporary bool, maxUsers uint32) *mumble.Channel
Create creates a new channel. Returns the channel or nil on error.
func (*Manager) GetChannel ¶
GetChannel returns a channel by ID.
func (*Manager) GetChannelWithMeta ¶
func (m *Manager) GetChannelWithMeta(channelID uint32) (ch *mumble.Channel, inheritACL bool, ok bool)
GetChannelWithMeta returns the channel and its InheritACL. ok is false if not found.
func (*Manager) LinkedChannelIDs ¶
LinkedChannelIDs returns the channel ID and its linked channel IDs.
func (*Manager) NextID ¶
NextID returns the next unused channel ID for temporary channels (in-memory only).
func (*Manager) Reload ¶
func (m *Manager) Reload()
Reload re-reads the channel tree from the database. Use when the DB may have been modified outside this manager (e.g. by another process or REST when using a fallback manager).
func (*Manager) Remove ¶
Remove removes a channel. Returns false if channel not found, is root, or has children.
func (*Manager) SubtreeIDs ¶
SubtreeIDs returns all channel IDs in the subtree rooted at id (including id).