app

package
v0.0.0-...-20dc6fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApp

func NewApp() *cli.App

NewApp creates a new cli App instance with common flags pre-loaded.

func NewAppWithMode

func NewAppWithMode() *cli.App

NewAppWithMode creates a new cli App instance with mode flag

func NewDBFromContext

func NewDBFromContext(c *cli.Context) (*sqlx.DB, error)

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

func NewLogger(c *cli.Context) (*zap.Logger, error)

NewLogger creates a new logger instance. The type of logger instance will be different with different application running modes.

func NewPostgreSQLFlags

func NewPostgreSQLFlags(defaultDB string) []cli.Flag

NewPostgreSQLFlags creates new cli flags for PostgreSQL client.

func NewSentryFlags

func NewSentryFlags() []cli.Flag

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.

func Validate

func Validate(c *cli.Context) error

Validate validates common application configuration flags.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL