47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"git.asio.asia/nixevol/NixMsg/internal/app/group"
|
|
"git.asio.asia/nixevol/NixMsg/internal/app/identity"
|
|
"git.asio.asia/nixevol/NixMsg/internal/app/message"
|
|
"git.asio.asia/nixevol/NixMsg/internal/app/port"
|
|
"git.asio.asia/nixevol/NixMsg/internal/app/presence"
|
|
"git.asio.asia/nixevol/NixMsg/internal/auth"
|
|
)
|
|
|
|
// appDeps 是组装出的模块依赖(测试与骨架仍可调用 wire)。
|
|
type appDeps struct {
|
|
HashPool auth.HashPool
|
|
SessionTokens auth.SessionTokens
|
|
APITokens auth.APITokens
|
|
LoginLocks auth.LoginLocks
|
|
|
|
Messages message.Service
|
|
Identity identity.Service
|
|
Groups group.Service
|
|
Presence presence.Service
|
|
|
|
Uplink port.UplinkHandler
|
|
Downlink port.Downlink
|
|
Conns port.ConnControl
|
|
}
|
|
|
|
// wire 返回真实 auth 实现与空业务桩(无 DB 时的轻量装配;正式 serve 走 assembleRuntime)。
|
|
func wire() appDeps {
|
|
return appDeps{
|
|
HashPool: auth.NewPool(),
|
|
SessionTokens: auth.NewSessionTokens(),
|
|
APITokens: auth.NewAPITokens(),
|
|
LoginLocks: auth.NewLoginLocks(),
|
|
|
|
Messages: message.NewStub(),
|
|
Identity: identity.NewStub(),
|
|
Groups: group.NewStub(),
|
|
Presence: presence.NewStub(),
|
|
|
|
Uplink: port.StubUplinkHandler{},
|
|
Downlink: &port.StubDownlink{},
|
|
Conns: &port.StubConnControl{},
|
|
}
|
|
}
|