Documentation
¶
Index ¶
- Variables
- type Command
- type CommandRunner
- type Env
- type FiberLogger
- type FxLogger
- type GormLogger
- func (l GormLogger) Error(_ context.Context, str string, args ...any)
- func (l GormLogger) Info(_ context.Context, str string, args ...any)
- func (l GormLogger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
- func (l GormLogger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l GormLogger) Warn(_ context.Context, str string, args ...any)
- type Logger
- type ModelBase
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // Short returns string about short description of the command // the string is shown in help screen of cobra command Short() string // Setup is used to setup flags or pre-run steps for the command. // // For example, // cmd.Flags().IntVarP(&r.num, "num", "n", 5, "description") // Setup(cmd *cobra.Command) // Run runs the command runner // run returns command runner which is a function with dependency // injected arguments. // // For example, // Command{ // Run: func(l *lib.Logger) { // l.Info("i am working") // }, // } // Run() CommandRunner }
Command interface is used to implement sub-commands in the system.
type CommandRunner ¶
type CommandRunner any
type Env ¶
type Env struct { Port string `mapstructure:"PORT"` Environment string `mapstructure:"ENVIRONMENT"` LogOutput string `mapstructure:"LOG_OUTPUT"` LogLevel string `mapstructure:"LOG_LEVEL"` DatabaseType string `mapstructure:"DATABASE_TYPE"` DatabaseUrl string `mapstructure:"DATABASE_URL"` MaxMultipartMemory int64 `mapstructure:"MAX_MULTIPART_MEMORY"` JWTAccessSecret string `mapstructure:"JWT_ACCESS_SECRET"` JWTRefreshSecret string `mapstructure:"JWT_REFRESH_SECRET"` AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"` RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"` AWSAccessKeyID string `mapstructure:"AWS_ACCESS_KEY_ID"` AWSSecretAccessKey string `mapstructure:"AWS_SECRET_ACCESS_KEY"` AWSRegion string `mapstructure:"AWS_REGION"` AWSS3Bucket string `mapstructure:"AWS_S3_BUCKET"` TimeZone string `mapstructure:"TIMEZONE"` AdminEmail string `mapstructure:"ADMIN_EMAIL"` AdminPassword string `mapstructure:"ADMIN_PASSWORD"` }
type FiberLogger ¶
type FiberLogger struct {
*Logger
}
FiberLogger logger for fiber framework [subbed from main logger]
type FxLogger ¶
type FxLogger struct {
*Logger
}
FxLogger logger for go-fx [subbed from main logger]
type GormLogger ¶
type GormLogger struct { *Logger gormlogger.Config // contains filtered or unexported fields }
GormLogger logger for gorm logging [subbed from main logger]
func (GormLogger) Error ¶
func (l GormLogger) Error(_ context.Context, str string, args ...any)
Error prints error messages
func (GormLogger) Info ¶
func (l GormLogger) Info(_ context.Context, str string, args ...any)
Info prints info
func (GormLogger) LogMode ¶
func (l GormLogger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
LogMode set log mode
type Logger ¶
type Logger struct {
*zap.SugaredLogger
}
Logger structure
func (Logger) GetFiberLogger ¶
GetFiberLogger gets logger for fiber framework debugging
func (Logger) GetFxLogger ¶
GetFxLogger gets logger for go-fx
func (Logger) GetGormLogger ¶
func (l Logger) GetGormLogger() gormlogger.Interface
GetGormLogger build gorm logger from zap logger (sub-logger)
Click to show internal directories.
Click to hide internal directories.