Documentation ¶
Index ¶
- Variables
- func GConfigs() abstract.ConfigProvider
- func GResourceDir()
- func GWorkDir()
- func InitApp(options ...Option) error
- func IsLocalEnv() bool
- func IsProdEnv() bool
- func IsTestEnv() bool
- func SetupApp()
- type Application
- type Option
- func WithConfigurator(provider abstract.ConfigProvider) Option
- func WithHandler(handlers ...abstract.Handler) Option
- func WithLicenseChecker(checker abstract.LicenseChecker) Option
- func WithLogger(provider abstract.LoggerProvider) Option
- func WithStarter(starters ...abstract.Starter) Option
- func WithWorkerDir(dir string) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AppName = "small-sparrow" Version = "0.0.1" VerifyLicense = "true" )
Functions ¶
func GResourceDir ¶
func GResourceDir()
func IsLocalEnv ¶
func IsLocalEnv() bool
Types ¶
type Application ¶
type Application struct { Env *runtime.Env LicenseChecker abstract.LicenseChecker // 证书校验器 LoggerProvider abstract.LoggerProvider ConfigProvider abstract.ConfigProvider Starters []abstract.Starter Handlers []abstract.Handler }
func (Application) Print ¶
func (app Application) Print()
type Option ¶
type Option func(app *Application)
func WithConfigurator ¶
func WithConfigurator(provider abstract.ConfigProvider) Option
func WithHandler ¶
func WithLicenseChecker ¶
func WithLicenseChecker(checker abstract.LicenseChecker) Option
func WithLogger ¶
func WithLogger(provider abstract.LoggerProvider) Option
func WithStarter ¶
func WithWorkerDir ¶
Click to show internal directories.
Click to hide internal directories.