Documentation
¶
Overview ¶
Package platform is the facade of the platform module (shared-kernel concerns: audit/message logs and their retention settings; system configuration joins as migration proceeds). See docs/adr-001-modular-monolith.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRepoBuilder ¶ added in v1.15.2
func NewRepoBuilder() repository.PlatformBuilder
NewRepoBuilder exports the module-owned repository implementations for store assembly (ADR-001 step-6 preparation).
Types ¶
type Deps ¶
type Deps struct {
Logs repository.LogRepo
System repository.SystemRepo
Traffic auditlog.TrafficReader
Store auditlog.PlatformTransactor
// OnLogSettingChanged propagates a committed retention change to the
// running configuration.
OnLogSettingChanged func(autoClear bool, clearDays int64)
// LogRetention reads the current (mutable) retention configuration.
LogRetention func() (autoClear bool, clearDays int64)
// System-setting dependencies (see internal/systemsetting).
Reinitialize func(subsystem string)
Restart func() error
SubscribePath func() string
ApplyVerifyConfig func(req *dto.VerifyConfig)
Multiplier systemsetting.MultiplierFunc
// Dashboard read ports and cache.
Orders dashboard.OrderStatsReader
Users dashboard.UserStatsReader
Tickets dashboard.TicketStatsReader
Nodes dashboard.NodeStatsReader
Cache dashboard.Cache
// Public-info dependencies: the full read surface, the shared Redis
// cache and the runtime-mutable public configuration snapshot.
FullStore repository.Store
Redis *redis.Client
PublicConfig func() GlobalConfigSnapshot
// Tool dependencies: the logger output path and the GeoIP reader.
LogPath string
GeoIP func() *geoip2.Reader
}
Deps declares everything the module needs; the composition root (internal/svc) provides them.
type GlobalConfigSnapshot ¶
type GlobalConfigSnapshot = publicinfo.GlobalConfigSnapshot
GlobalConfigSnapshot re-exports the public-info subdomain's per-request view of the public runtime configuration for the composition root.
type Service ¶
type Service interface {
FilterBalanceLog(ctx context.Context, req *dto.FilterBalanceLogRequest) (*dto.FilterBalanceLogResponse, error)
FilterCommissionLog(ctx context.Context, req *dto.FilterCommissionLogRequest) (*dto.FilterCommissionLogResponse, error)
FilterEmailLog(ctx context.Context, req *dto.FilterLogParams) (*dto.FilterEmailLogResponse, error)
FilterGiftLog(ctx context.Context, req *dto.FilterGiftLogRequest) (*dto.FilterGiftLogResponse, error)
FilterLoginLog(ctx context.Context, req *dto.FilterLoginLogRequest) (*dto.FilterLoginLogResponse, error)
FilterMobileLog(ctx context.Context, req *dto.FilterLogParams) (*dto.FilterMobileLogResponse, error)
FilterRegisterLog(ctx context.Context, req *dto.FilterRegisterLogRequest) (*dto.FilterRegisterLogResponse, error)
FilterResetSubscribeLog(ctx context.Context, req *dto.FilterResetSubscribeLogRequest) (*dto.FilterResetSubscribeLogResponse, error)
FilterServerTrafficLog(ctx context.Context, req *dto.FilterServerTrafficLogRequest) (*dto.FilterServerTrafficLogResponse, error)
FilterSubscribeLog(ctx context.Context, req *dto.FilterSubscribeLogRequest) (*dto.FilterSubscribeLogResponse, error)
FilterTrafficLogDetails(ctx context.Context, req *dto.FilterTrafficLogDetailsRequest) (*dto.FilterTrafficLogDetailsResponse, error)
FilterUserSubscribeTrafficLog(ctx context.Context, req *dto.FilterSubscribeTrafficRequest) (*dto.FilterSubscribeTrafficResponse, error)
GetLogSetting(ctx context.Context) (*dto.LogSetting, error)
// UpdateLogSetting persists the retention settings and propagates them to
// the running configuration.
UpdateLogSetting(ctx context.Context, req *dto.LogSetting) error
GetMessageLogList(ctx context.Context, req *dto.GetMessageLogListRequest) (*dto.GetMessageLogListResponse, error)
// System configuration management; updates persist the settings and
// re-initialize the owning subsystem through injected callbacks.
GetCurrencyConfig(ctx context.Context) (*dto.CurrencyConfig, error)
GetInviteConfig(ctx context.Context) (*dto.InviteConfig, error)
GetModuleConfig(ctx context.Context) (*dto.ModuleConfig, error)
GetNodeConfig(ctx context.Context) (*dto.NodeConfig, error)
GetNodeMultiplier(ctx context.Context) (*dto.GetNodeMultiplierResponse, error)
GetPrivacyPolicyConfig(ctx context.Context) (*dto.PrivacyPolicyConfig, error)
GetRegisterConfig(ctx context.Context) (*dto.RegisterConfig, error)
GetSiteConfig(ctx context.Context) (*dto.SiteConfig, error)
GetSubscribeConfig(ctx context.Context) (*dto.SubscribeConfig, error)
GetTosConfig(ctx context.Context) (*dto.TosConfig, error)
GetVerifyCodeConfig(ctx context.Context) (*dto.VerifyCodeConfig, error)
GetVerifyConfig(ctx context.Context) (*dto.VerifyConfig, error)
PreViewNodeMultiplier(ctx context.Context) (*dto.PreViewNodeMultiplierResponse, error)
SetNodeMultiplier(ctx context.Context, req *dto.SetNodeMultiplierRequest) error
SettingTelegramBot(ctx context.Context) error
UpdateCurrencyConfig(ctx context.Context, req *dto.CurrencyConfig) error
UpdateInviteConfig(ctx context.Context, req *dto.InviteConfig) error
UpdateNodeConfig(ctx context.Context, req *dto.NodeConfig) error
UpdatePrivacyPolicyConfig(ctx context.Context, req *dto.PrivacyPolicyConfig) error
UpdateRegisterConfig(ctx context.Context, req *dto.RegisterConfig) error
UpdateSiteConfig(ctx context.Context, req *dto.SiteConfig) error
UpdateSubscribeConfig(ctx context.Context, req *dto.SubscribeConfig) error
UpdateTosConfig(ctx context.Context, req *dto.TosConfig) error
UpdateVerifyCodeConfig(ctx context.Context, req *dto.VerifyCodeConfig) error
UpdateVerifyConfig(ctx context.Context, req *dto.VerifyConfig) error
// Admin console reporting aggregates (cross-domain reads through ports).
QueryRevenueStatistics(ctx context.Context) (*dto.RevenueStatisticsResponse, error)
QueryServerTotalData(ctx context.Context) (*dto.ServerTotalDataResponse, error)
QueryTicketWaitReply(ctx context.Context) (*dto.TicketWaitRelpyResponse, error)
QueryUserStatistics(ctx context.Context) (*dto.UserStatisticsResponse, error)
// Admin utility tools: system log tail, version, IP geolocation and
// process restart.
GetSystemLog(ctx context.Context) (*dto.LogResponse, error)
GetVersion(ctx context.Context) (*dto.VersionResponse, error)
QueryIPLocation(ctx context.Context, req *dto.QueryIPLocationRequest) (*dto.QueryIPLocationResponse, error)
RestartSystem(ctx context.Context) error
// Unauthenticated site-level reads for the public portal.
GetGlobalConfig(ctx context.Context) (*dto.GetGlobalConfigResponse, error)
GetTos(ctx context.Context) (*dto.GetTosResponse, error)
GetPrivacyPolicy(ctx context.Context) (*dto.PrivacyPolicyConfig, error)
GetStat(ctx context.Context) (*dto.GetStatResponse, error)
GetClient(ctx context.Context) (*dto.GetSubscribeClientResponse, error)
Heartbeat(ctx context.Context) (*dto.HeartbeatResponse, error)
}
Service is the only surface other code may depend on; the implementation lives under internal/ where the compiler seals it off.
Directories
¶
| Path | Synopsis |
|---|---|
|
entity
|
|
|
outbox
Package outbox holds the generic domain-event outbox row (ADR-001 step-6 preparation): appended in the owning domain's transaction, published onto the asynq queue by the dispatch pump, consumed idempotently via the inbox.
|
Package outbox holds the generic domain-event outbox row (ADR-001 step-6 preparation): appended in the owning domain's transaction, published onto the asynq queue by the dispatch pump, consumed idempotently via the inbox. |
|
internal
|
|
|
auditlog
Package auditlog implements the audit/message log subdomain of the platform module: filtered views over the system log, message log listing and the log retention settings.
|
Package auditlog implements the audit/message log subdomain of the platform module: filtered views over the system log, message log listing and the log retention settings. |
|
dashboard
Package dashboard implements the admin console subdomain of the platform module: cross-domain reporting aggregates.
|
Package dashboard implements the admin console subdomain of the platform module: cross-domain reporting aggregates. |
|
publicinfo
Service assembly for the public-info subdomain: unauthenticated site-level reads (global configuration, ToS/privacy, aggregate stats, client downloads, liveness).
|
Service assembly for the public-info subdomain: unauthenticated site-level reads (global configuration, ToS/privacy, aggregate stats, client downloads, liveness). |
|
systemsetting
Package systemsetting implements the system configuration subdomain of the platform module.
|
Package systemsetting implements the system configuration subdomain of the platform module. |
|
tool
Service assembly for the tool subdomain of the platform module: system log tail, version info, IP geolocation and process restart.
|
Service assembly for the tool subdomain of the platform module: system log tail, version info, IP geolocation and process restart. |