Documentation
¶
Index ¶
- Constants
- Variables
- func BeforeBootup(key string)
- func CloseOnlyNotified()
- func Decrypt(key, src []byte) ([]byte, error)
- func Encrypt(key, raw []byte) ([]byte, error)
- func EncryptConfig() error
- func GetContainer() *dig.Container
- func InitConfig(p Bootup) error
- func InitEmbedConfig()
- func InitLogger(p Bootup) (*zap.Logger, error)
- func InvokeAsyncOnServiceStarted(fn any)
- func InvokeOnServiceStarted(fn any)
- func NotifyStarted()
- func NotifyStopping()
- func OnEvent(topic string, fn any)
- func OnServiceStarted(fn SystenEvent)
- func OnServiceStopping(fn SystenEvent)
- func PrintVersion()
- func Provide(constructor ...interface{})
- func ProvideStartup(constructor ...any)
- func ReadEncryptConfig(secret []byte, toFile string) error
- func ToEmbedConfig(content []byte, keys ...string)
- type Bootup
- type ConfigSecret
- type EmbedConfigReady
- type OptionalParam
- type ServiceParam
- type Startup
- type SystenEvent
Constants ¶
View Source
const ( EventError = "event.error" EventTracing = "event.tracing" EventInit = "event.gin.inited" //trigger when gin ready to service. EventStopping = "event.gin.stopping" EventStarted = "sys.started" //trigger when all inited done. )
View Source
const (
EncryptedFile = "config/app.cfg"
)
Variables ¶
View Source
var AppName = "RFID App"
View Source
var Bus = EventBus.New()
View Source
var ConfigFolder = "config"
View Source
var Container = dig.New()
View Source
var StartupOptions = dig.Group("startups")
View Source
var Version = "latest"
Functions ¶
func BeforeBootup ¶ added in v0.8.20
func BeforeBootup(key string)
func CloseOnlyNotified ¶ added in v0.8.15
func CloseOnlyNotified()
func EncryptConfig ¶ added in v0.8.14
func EncryptConfig() error
func GetContainer ¶
func InitConfig ¶
func InitEmbedConfig ¶ added in v0.8.17
func InitEmbedConfig()
make sure run it in main before init anything, just make sure, all embed config inited.
func InvokeAsyncOnServiceStarted ¶ added in v0.8.15
func InvokeAsyncOnServiceStarted(fn any)
func InvokeOnServiceStarted ¶ added in v0.8.15
func InvokeOnServiceStarted(fn any)
func NotifyStarted ¶ added in v0.7.8
func NotifyStarted()
func NotifyStopping ¶ added in v0.8.11
func NotifyStopping()
func OnServiceStarted ¶ added in v0.8.11
func OnServiceStarted(fn SystenEvent)
OnServiceStarted make sure call this func after
func OnServiceStopping ¶ added in v0.8.11
func OnServiceStopping(fn SystenEvent)
func PrintVersion ¶ added in v0.8.15
func PrintVersion()
func ProvideStartup ¶ added in v0.5.1
func ProvideStartup(constructor ...any)
func ReadEncryptConfig ¶ added in v0.8.14
func ToEmbedConfig ¶ added in v0.5.4
Types ¶
type Bootup ¶ added in v0.5.4
type Bootup struct { dig.In Secret ConfigSecret EmbedConfigReady EmbedConfigReady }
type ConfigSecret ¶ added in v0.8.14
type ConfigSecret []byte
type EmbedConfigReady ¶ added in v0.8.17
type EmbedConfigReady interface{}
type OptionalParam ¶ added in v0.5.7
type ServiceParam ¶ added in v0.8.3
type SystenEvent ¶ added in v0.8.11
type SystenEvent func()
Click to show internal directories.
Click to hide internal directories.