infrastructure

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAWSS3Config added in v0.3.0

func GetAWSS3Config(l *logger.Logger, id, secret, token, region, endpoint string, isMinio bool) *aws.Config

GetAWSS3Config get config.

func GetAWSS3ConfigNoCredentials added in v0.3.0

func GetAWSS3ConfigNoCredentials(l *logger.Logger, region, endpoint string, isMinio bool) *aws.Config

GetAWSS3ConfigNoCredentials 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 GetAWSS3ConfigNoCredentialsZap added in v0.3.0

func GetAWSS3ConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string, isMinio bool) *aws.Config

GetAWSS3ConfigNoCredentialsZap 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 GetAWSS3ConfigZap added in v0.3.0

func GetAWSS3ConfigZap(l *logger.ZapLogger, id, secret, token, region, endpoint string, isMinio bool) *aws.Config

GetAWSS3ConfigZap get config.

func GetAWSSESConfig added in v0.3.0

func GetAWSSESConfig(l *logger.Logger, id, secret, token, region, endpoint string) *aws.Config

GetAWSSESConfig get config.

func GetAWSSESConfigNoCredentials added in v0.3.0

func GetAWSSESConfigNoCredentials(l *logger.Logger, region, endpoint string) *aws.Config

GetAWSSESConfigNoCredentials 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 GetAWSSESConfigZap added in v0.3.0

func GetAWSSESConfigZap(l *logger.ZapLogger, id, secret, token, region, endpoint string) *aws.Config

GetAWSSESConfigZap get config.

func GetAWSV2S3Config added in v0.3.0

func GetAWSV2S3Config(l *logger.Logger, key, secret, sessionToken, region, endpoint string, isMinio bool) (aws.Config, error)

GetAWSV2S3Config get config.

func GetAWSV2S3ConfigNoCredentials added in v0.3.0

func GetAWSV2S3ConfigNoCredentials(l *logger.Logger, region, endpoint string, isMinio bool) (aws.Config, error)

GetAWSV2S3ConfigNoCredentials 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 GetAWSV2S3ConfigNoCredentialsZap added in v0.3.0

func GetAWSV2S3ConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string, isMinio bool) (aws.Config, error)

GetAWSV2S3ConfigNoCredentialsZap 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 GetAWSV2S3ConfigZap added in v0.3.0

func GetAWSV2S3ConfigZap(l *logger.ZapLogger, key, secret, sessionToken, region, endpoint string, isMinio bool) (aws.Config, error)

GetAWSV2S3ConfigZap get config.

func GetAWSV2SESConfig added in v0.3.0

func GetAWSV2SESConfig(l *logger.Logger, key, secret, sessionToken, region, endpoint string) (aws.Config, error)

GetSESConfig get config.

func GetAWSV2SESConfigNoCredentials added in v0.3.0

func GetAWSV2SESConfigNoCredentials(l *logger.Logger, region, endpoint string) (aws.Config, error)

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 GetAWSV2SESConfigNoCredentialsZap added in v0.3.0

func GetAWSV2SESConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string) (aws.Config, error)

GetAWSV2SESConfigNoCredentialsZap 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 GetAWSV2SESConfigZap added in v0.3.0

func GetAWSV2SESConfigZap(l *logger.ZapLogger, key, secret, sessionToken, region, endpoint string) (aws.Config, error)

GetSESConfigZap get config.

func GetDefaultGormConfig

func GetDefaultGormConfig() *gorm.Config

GetDefaultGormConfig get default config.

func GetSESConfigNoCredentialsZap added in v0.0.28

func GetSESConfigNoCredentialsZap(l *logger.ZapLogger, region, endpoint string) *aws.Config

GetAWSSESConfigNoCredentialsZap 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 NewAWSS3 added in v0.3.0

func NewAWSS3(o *session.Options, c *aws.Config) *s3.S3

NewAWSS3 returns S3.

func NewAWSS3Downloader added in v0.3.0

func NewAWSS3Downloader(s *session.Session) *s3manager.Downloader

NewAWSS3Downloader returns Downloader.

func NewAWSS3Session added in v0.3.0

func NewAWSS3Session(o *session.Options) *session.Session

NewAWSS3Session returns Session.

func NewAWSS3Uploader added in v0.3.0

func NewAWSS3Uploader(s *session.Session) *s3manager.Uploader

NewAWSS3Uploader returns Uploader.

func NewAWSSES added in v0.3.0

func NewAWSSES(
	o *session.Options,
	c *aws.Config,
) *ses.SES

NewAWSSES returns ses instance.

func NewAWSV2S3 added in v0.3.0

func NewAWSV2S3(c *aws.Config, optFns ...func(*s3.Options)) *s3.Client

NewAWSS3 returns S3.

func NewAWSV2S3Downloader added in v0.3.0

func NewAWSV2S3Downloader(c manager.DownloadAPIClient, options ...func(*manager.Downloader)) *manager.Downloader

NewAWSV2S3Downloader returns Downloader.

func NewAWSV2S3Uploader added in v0.3.0

func NewAWSV2S3Uploader(c manager.UploadAPIClient, options ...func(*manager.Uploader)) *manager.Uploader

NewAWSV2S3Uploader returns Uploader.

func NewAWSV2SES added in v0.3.0

func NewAWSV2SES(c aws.Config, optFns ...func(*sesv2.Options)) *sesv2.Client

NewAWSV2 returns ses instance.

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 NewRedis added in v0.0.18

func NewRedis(o *redis.Options) *redis.Client

NewRedis returns redis client.

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

type MySQLConfig struct {
	Config *mysql.Config
	DBConfig
}

MySQLConfig sets configurations.

type PostgresConfig

type PostgresConfig struct {
	Config *postgres.Config
	DBConfig
}

PostgresConfig sets configurations.

type SQLServerConfig

type SQLServerConfig struct {
	Config *sqlserver.Config
	DBConfig
}

SQLServerConfig sets configurations.

type SlackConfig

type SlackConfig struct {
	OauthAccessToken string
}

SlackConfig sets configurations.

Jump to

Keyboard shortcuts

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