Documentation
¶
Index ¶
- Constants
- func DownloadGeoIPDatabase(url, path string) error
- func NewAsynqClient(c config.Config) *asynqx.Client
- func NewAsynqInspector(c config.Config) *asynq.Inspector
- func NewDeviceManager(srv *Application) *device.DeviceManager
- func NewStore(db *gorm.DB, rds *redis.Client) *repository.GormStore
- type Application
- type DeviceMessage
- type DeviceMessageMethod
- type IPLocation
Constants ¶
View Source
const GeoIPDBURL = "https://raw.githubusercontent.com/adysec/IP_database/main/geolite/GeoLite2-City.mmdb"
Variables ¶
This section is empty.
Functions ¶
func DownloadGeoIPDatabase ¶ added in v1.2.0
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) *device.DeviceManager
Types ¶
type Application ¶ added in v1.19.0
type Application struct {
Redis *redis.Client
Runtime *appstate.State
Queue *asynqx.Client
Inspector *asynq.Inspector
ExchangeRate *exchangeRate.Cache
GeoIP *IPLocation
Store repository.Store
// Domain modules (see docs/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 *limit.PeriodLimit
DeviceManager *device.DeviceManager
}
func NewApplication ¶ added in v1.19.0
func NewApplication(c config.Config) *Application
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 IPLocation ¶ added in v1.2.0
func NewIPLocation ¶ added in v1.2.0
func NewIPLocation(path string) (*IPLocation, error)
func (*IPLocation) Close ¶ added in v1.2.0
func (ipLoc *IPLocation) Close() error
Click to show internal directories.
Click to hide internal directories.