Documentation
¶
Index ¶
- Constants
- func Config(path string) (chan bool, *server.Hertz)
- func Currency(ctx *Dependencies)
- func Device(ctx *Dependencies)
- func Email(ctx *Dependencies)
- func HandleDatabaseTest(_ context.Context, ctx *app.RequestContext)
- func HandleMySQLTest(ctx context.Context, requestCtx *app.RequestContext)
- func HandleRedisTest(_ context.Context, ctx *app.RequestContext)
- func Invite(ctx *Dependencies)
- func Migrate(ctx *Dependencies)
- func Mobile(ctx *Dependencies)
- func Node(ctx *Dependencies)
- func NodeSecret(svcCtx *Dependencies)
- func Register(ctx *Dependencies)
- func Site(ctx *Dependencies)
- func StartInitSystemConfig(deps *Dependencies)
- func Subscribe(svc *Dependencies)
- func Telegram(svc *Dependencies)
- func Verify(svc *Dependencies)
- type Dependencies
Constants ¶
const LegacyDefaultNodeSecret = "12345678"
LegacyDefaultNodeSecret is the node secret the original seed data shipped. The value is public knowledge, so an installation still carrying it serves the node API — which hands out every user's subscription uuid — to anyone.
Variables ¶
This section is empty.
Functions ¶
func Currency ¶ added in v1.2.5
func Currency(ctx *Dependencies)
func Device ¶ added in v1.1.8
func Device(ctx *Dependencies)
func HandleDatabaseTest ¶ added in v1.2.12
func HandleDatabaseTest(_ context.Context, ctx *app.RequestContext)
func HandleMySQLTest ¶
func HandleMySQLTest(ctx context.Context, requestCtx *app.RequestContext)
func HandleRedisTest ¶
func HandleRedisTest(_ context.Context, ctx *app.RequestContext)
func Invite ¶
func Invite(ctx *Dependencies)
func Migrate ¶
func Migrate(ctx *Dependencies)
func Mobile ¶
func Mobile(ctx *Dependencies)
func Node ¶
func Node(ctx *Dependencies)
func NodeSecret ¶ added in v1.16.0
func NodeSecret(svcCtx *Dependencies)
NodeSecret provisions a random node secret when the database does not carry one yet, so a fresh installation never serves the node API with a guessable credential. It has to run after Migrate, which seeds the empty row, and before Node, which copies the value into the runtime config.
An installation still holding LegacyDefaultNodeSecret is only reported, never rotated: every node was configured with that secret, so rotating it here would silently cut them off. The operator rotates it from the admin panel and reconfigures the nodes in the same window.
func Register ¶
func Register(ctx *Dependencies)
func Site ¶
func Site(ctx *Dependencies)
func StartInitSystemConfig ¶
func StartInitSystemConfig(deps *Dependencies)
func Subscribe ¶
func Subscribe(svc *Dependencies)
func Telegram ¶
func Telegram(svc *Dependencies)
Telegram (re)initialises the bot from the stored configuration. On failure it returns without touching the running state, so a transient error during re-initialisation leaves the previous bot working instead of none at all.
func Verify ¶
func Verify(svc *Dependencies)
Types ¶
type Dependencies ¶ added in v1.19.0
type Dependencies struct {
Config func() config.Config
UpdateConfig func(func(*config.Config))
Store repository.Store
ExchangeRate *exchangeRate.Cache
Notification notification.Service
SetTelegramBot func(*tgbot.Bot)
SetNodeMultiplierManager func(*nodeMultiplier.Manager)
}
Dependencies is the startup/reconfiguration boundary. It owns only mutable runtime configuration and the services needed to load or publish it.