Documentation
¶
Index ¶
- func NewAsynqClient(c config.Config) *taskqueue.Client
- func NewAsynqInspector(c config.Config) *asynq.Inspector
- func NewDeviceManager(srv *Application) *devicesocket.DeviceManager
- func NewStore(db *gorm.DB, rds *redis.Client) *repository.GormStore
- type Application
- type Dependencies
- type DeviceMessage
- type DeviceMessageMethod
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAsynqClient ¶
NewAsynqClient returns the tracing asynq client: EnqueueContext stamps the caller's trace context onto the task for the worker-side middleware to resume. Pass task options to EnqueueContext, not NewTask — wrapping rebuilds the task.
func NewDeviceManager ¶
func NewDeviceManager(srv *Application) *devicesocket.DeviceManager
Types ¶
type Application ¶
type Application struct {
Redis *redis.Client
Runtime *state.State
Queue *taskqueue.Client
Inspector *asynq.Inspector
ExchangeRate *billing.CurrencyRateCache
GeoIP *geoip.IPLocation
Store repository.Store
// Domain modules (see docs/design/adr-001-modular-monolith.md). Application is
// their composition root; handlers call the module facades.
Support support.Service
Billing billing.Service
Platform platform.Service
Subscription subscription.Service
Identity identity.Service
Network network.Service
Notification notification.Service
EventBus *eventbus.Bus
//NodeCache *cache.NodeCacheClient
AuthLimiter *ratelimit.PeriodLimit
DeviceManager *devicesocket.DeviceManager
}
func NewApplication ¶
func NewApplication(c config.Config) *Application
type Dependencies ¶
type Dependencies struct {
Config func() config.Config
Store repository.Store
Bootstrap *bootstrap.Dependencies
HTTP func() httpserver.Dependencies
SetRestart func(func() error)
SetReinitializeHandler func(func(string))
}
type DeviceMessage ¶
type DeviceMessage struct {
Method DeviceMessageMethod `json:"method"`
}
func (*DeviceMessage) Json ¶
func (dm *DeviceMessage) Json() string
type DeviceMessageMethod ¶
type DeviceMessageMethod string
const ( // DeviceKickedMax 设备数量超出限制 DeviceKickedMax DeviceMessageMethod = "kicked_device" // DeviceKickedAdmin 管理员踢下线 DeviceKickedAdmin DeviceMessageMethod = "kicked_admin" // SubscribeUpdate 订阅有更新 SubscribeUpdate DeviceMessageMethod = "subscribe_update" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(deps Dependencies) *Service
Source Files
¶
Click to show internal directories.
Click to hide internal directories.