Documentation ¶
Index ¶
- func GetDefaultGormConfig() *gorm.Config
- func GetS3Config(l *logger.Logger, id, secret, token, region, endpoint string, isMinio bool) *aws.Config
- func GetS3ConfigNoCredentials(l *logger.Logger, region, endpoint string, isMinio bool) *aws.Config
- func GetS3ConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string, isMinio bool) *aws.Config
- func GetS3ConfigZap(l *logger.ZapLogger, id, secret, token, region, endpoint string, isMinio bool) *aws.Config
- func GetSESConfig(l *logger.Logger, id, secret, token, region, endpoint string) *aws.Config
- func GetSESConfigNoCredentials(l *logger.Logger, region, endpoint string) *aws.Config
- func GetSESConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string) *aws.Config
- func GetSESConfigZap(l *logger.ZapLogger, id, secret, token, region, endpoint string) *aws.Config
- func NewDownloader(s *session.Session) *s3manager.Downloader
- func NewMySQL(c *MySQLConfig, gc *gorm.Config) *gorm.DB
- func NewPostgres(c *PostgresConfig, gc *gorm.Config) *gorm.DB
- func NewRedis(o *redis.Options) *redis.Client
- func NewS3(o *session.Options, c *aws.Config) *s3.S3
- func NewS3Session(o *session.Options) *session.Session
- 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
- func NewUploader(s *session.Session) *s3manager.Uploader
- type DBConfig
- 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 GetS3Config ¶
func GetS3Config(l *logger.Logger, 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 GetS3ConfigNoCredentialsZap ¶ added in v0.0.28
func GetS3ConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string, isMinio bool) *aws.Config
GetS3ConfigNoCredentialsZap 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 GetS3ConfigZap ¶ added in v0.0.28
func GetS3ConfigZap(l *logger.ZapLogger, id, secret, token, region, endpoint string, isMinio bool) *aws.Config
GetS3ConfigZap get config.
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 GetSESConfigNoCredentialsZap ¶ added in v0.0.28
GetSESConfigNoCredentialsZap 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 GetSESConfigZap ¶ added in v0.0.28
GetSESConfigZap get config.
func NewDownloader ¶ added in v0.0.18
func NewDownloader(s *session.Session) *s3manager.Downloader
NewDownloader returns Downloader.
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 NewS3Session ¶ added in v0.0.18
NewS3Session returns Session.
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 MySQLConfig ¶
MySQLConfig sets configurations.
type PostgresConfig ¶
PostgresConfig sets configurations.
type SQLServerConfig ¶
SQLServerConfig sets configurations.
type SlackConfig ¶
type SlackConfig struct {
OauthAccessToken string
}
SlackConfig sets configurations.