mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 06:36:38 +08:00
43dc97e48c
- Moved cmd/, core/, plugins/, pkg/, downstream/, and main.go into backend/ directory - Batch updated all Go source files to import github.com/Rain-kl/Wavelet/backend/... - Updated Makefile, scripts/swagger.sh, architecture guards, and platform skills - Passed all quality gates (100% tests, 0 lint issues, clean build)
27 lines
526 B
Go
27 lines
526 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package message_gateway
|
|
|
|
import "sync"
|
|
|
|
var (
|
|
factoriesMu sync.RWMutex
|
|
factories = map[string]Factory{}
|
|
)
|
|
|
|
// Register stores a channel factory under typ.
|
|
func Register(typ string, fn Factory) {
|
|
factoriesMu.Lock()
|
|
defer factoriesMu.Unlock()
|
|
factories[typ] = fn
|
|
}
|
|
|
|
// Lookup returns a previously registered factory.
|
|
func Lookup(typ string) (Factory, bool) {
|
|
factoriesMu.RLock()
|
|
defer factoriesMu.RUnlock()
|
|
fn, ok := factories[typ]
|
|
return fn, ok
|
|
}
|