Documentation ¶
Index ¶
- func GetDefaultGormConfig() *gorm.Config
- func GetDefaultOptions() *session.Options
- func GetS3Config(e *logrus.Entry, id, secret, token, region, endpoint string, isMinio bool) *aws.Config
- func GetS3ConfigNoCredentials(e *logrus.Entry, region, endpoint string, isMinio bool) *aws.Config
- func GetSESConfig(e *logrus.Entry, id, secret, token, region, endpoint string) *aws.Config
- func GetSESConfigNoCredentials(e *logrus.Entry, region, endpoint string) *aws.Config
- func NewMySQL(c *MySQLConfig, gc *gorm.Config) *gorm.DB
- func NewPostgres(c *PostgresConfig, gc *gorm.Config) *gorm.DB
- func NewS3(o *session.Options, c *aws.Config) *s3.S3
- func NewSES(o *session.Options, c *aws.Config) *ses.SES
- func NewSQLServer(c *SQLServerConfig, gc *gorm.Config) *gorm.DB
- func NewSlack(c *SlackConfig) *slack.Client
- type DBConfig
- type GormConfig
- type Interface
- type LogLevel
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugln(args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalln(args ...interface{})
- func (l *Logger) GetEntry() *logrus.Entry
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Panicln(args ...interface{})
- func (l *Logger) Print(args ...interface{})
- func (l *Logger) Printf(format string, args ...interface{})
- func (l *Logger) Println(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- func (l *Logger) Warningln(args ...interface{})
- func (l *Logger) Warnln(args ...interface{})
- func (l *Logger) WithContext(ctx context.Context) *Logger
- func (l *Logger) WithContextValue(key string) *Logger
- func (l *Logger) WithError(err error) *Logger
- func (l *Logger) WithField(key string, value interface{}) *Logger
- func (l *Logger) WithFields(fields logrus.Fields) *Logger
- type LoggerGorm
- func (l *LoggerGorm) Error(ctx context.Context, msg string, data ...interface{})
- func (l *LoggerGorm) Info(ctx context.Context, msg string, data ...interface{})
- func (l *LoggerGorm) LogMode(level logger.LogLevel) logger.Interface
- func (l *LoggerGorm) Trace(ctx context.Context, begin time.Time, ...)
- func (l *LoggerGorm) Warn(ctx context.Context, msg string, data ...interface{})
- type LoggerGormConfig
- type MySQLConfig
- type PostgresConfig
- type SQLServerConfig
- type SlackConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultGormConfig ¶
GetDefaultGormConfig get default config.
func GetDefaultOptions ¶
GetDefaultOptions retrieves the options that enable SharedConfigState. Basically, Options assumes that an IAM role has been assigned in the execution environment.
func GetS3Config ¶
func GetS3Config(e *logrus.Entry, id, secret, token, region, endpoint string, isMinio bool) *aws.Config
GetS3Config get config.
func GetS3ConfigNoCredentials ¶
GetS3ConfigNoCredentials get no credentials config. If AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are environment variables and are in the execution environment, Credentials is not required.
func GetSESConfig ¶
GetSESConfig get config.
func GetSESConfigNoCredentials ¶
GetSESConfigNoCredentials get no credentials config. If AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are environment variables and are in the execution environment, Credentials is not required.
func NewMySQL ¶
func NewMySQL(c *MySQLConfig, gc *gorm.Config) *gorm.DB
NewMySQL returns an gorm db instance.
func NewPostgres ¶
func NewPostgres(c *PostgresConfig, gc *gorm.Config) *gorm.DB
NewPostgres returns an gorm db instance.
func NewSQLServer ¶
func NewSQLServer(c *SQLServerConfig, gc *gorm.Config) *gorm.DB
NewSQLServer returns an gorm db instance.
func NewSlack ¶
func NewSlack(c *SlackConfig) *slack.Client
NewSlack returns an SlackClient instance.
Types ¶
type DBConfig ¶
type DBConfig struct { // ConnMaxLifetime sets max life time(sec) ConnMaxLifetime time.Duration // ConnMaxIdletime sets max idle time(sec) ConnMaxIdletime time.Duration // MaxIdleConns sets idle connection MaxIdleConns int // MaxOpenConns sets max connection MaxOpenConns int }
DBConfig set configurations.
type GormConfig ¶
type GormConfig struct { // If the time specified by SlowThreshold is exceeded, it is displayed in the log as a SlowQuery. SlowThreshold time.Duration // If true is specified for IgnoreRecordNotFoundError, no log is output at the error level even if the record does not exist as a search result. // If false, logs are output at the error level when a record does not exist as a search result. IgnoreRecordNotFoundError bool // LogLevel outputs logs above the specified level. LogLevel LogLevel }
GormConfig set configurations.
type Interface ¶
type Interface interface { LogMode(logger.LogLevel) Interface Info(context.Context, string, ...interface{}) Warn(context.Context, string, ...interface{}) Error(context.Context, string, ...interface{}) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) }
Interface Gorm Logger interface.
type Logger ¶
Logger struct.
func (*Logger) Debugln ¶
func (l *Logger) Debugln(args ...interface{})
Debugln outputs debug level log.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(args ...interface{})
Errorln outputs error level log.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(args ...interface{})
Fatalln outputs fatal level log.
func (*Logger) Warning ¶
func (l *Logger) Warning(args ...interface{})
Warning outputs warn level log.
func (*Logger) Warningln ¶
func (l *Logger) Warningln(args ...interface{})
Warningln outputs warn level log.
func (*Logger) WithContext ¶
WithContext calls WithContext function of logger entry.
func (*Logger) WithContextValue ¶
WithContextValue calls WithField function of logger entry.
type LoggerGorm ¶
type LoggerGorm struct {
// contains filtered or unexported fields
}
LoggerGorm struct.
func (*LoggerGorm) Error ¶
func (l *LoggerGorm) Error(ctx context.Context, msg string, data ...interface{})
Error print the error level log.
func (*LoggerGorm) Info ¶
func (l *LoggerGorm) Info(ctx context.Context, msg string, data ...interface{})
Info print the info level log.
func (*LoggerGorm) LogMode ¶
func (l *LoggerGorm) LogMode(level logger.LogLevel) logger.Interface
LogMode log mode(same logrus.level)
type LoggerGormConfig ¶
type LoggerGormConfig struct { Logger *logrus.Logger GormConfig *GormConfig }
LoggerGormConfig sets configurations.
type MySQLConfig ¶
MySQLConfig sets configurations.
type PostgresConfig ¶
PostgresConfig sets configurations.
type SQLServerConfig ¶
SQLServerConfig sets configurations.
type SlackConfig ¶
type SlackConfig struct {
OauthAccessToken string
}
SlackConfig sets configurations.