Documentation ¶
Index ¶
- func NewApp() *cli.App
- func NewAppWithMode() *cli.App
- func NewDBFromContext(c *cli.Context) (*sqlx.DB, error)
- func NewFlusher(s syncer) func()
- func NewLogger(c *cli.Context) (*zap.Logger, error)
- func NewPostgreSQLFlags(defaultDB string) []cli.Flag
- func NewSentryFlags() []cli.Flag
- func NewSugaredLogger(c *cli.Context) (*zap.SugaredLogger, func(), error)
- func Validate(c *cli.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAppWithMode ¶
NewAppWithMode creates a new cli App instance with mode flag
func NewDBFromContext ¶
NewDBFromContext creates a DB instance from cli flags configuration.
func NewFlusher ¶
func NewFlusher(s syncer) func()
NewFlusher creates a new syncer from given syncer that log a error message if failed to sync.
func NewLogger ¶
NewLogger creates a new logger instance. The type of logger instance will be different with different application running modes.
func NewPostgreSQLFlags ¶
NewPostgreSQLFlags creates new cli flags for PostgreSQL client.
func NewSentryFlags ¶
NewSentryFlags returns flags to init sentry client
func NewSugaredLogger ¶
func NewSugaredLogger(c *cli.Context) (*zap.SugaredLogger, func(), error)
NewSugaredLogger creates a new sugared logger and a flush function. The flush function should be called by consumer before quitting application. This function should be use most of the time unless the application requires extensive performance, in this case use NewLogger.
Types ¶
This section is empty.