autoconfig

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CipherKey           = "cipher"
	CipherDisableKey    = CipherKey + ".disable"
	CipherKeyKey        = CipherKey + ".key"
	CipherHmacKeyKey    = CipherKey + ".hmac-key"
	CipherPublicKeyKey  = CipherKey + ".public-key"
	CipherPrivateKeyKey = CipherKey + ".private-key"
	CipherOrder         = 100
)
View Source
const (
	GormDatasourceKey        = "gorm"
	GormDatasourceDisableKey = GormDatasourceKey + ".disable"
	GormDatasourceOrder      = 20
)
View Source
const (
	MySQLDatasourceKey        = "mysql"
	MySQLDatasourceDisableKey = MySQLDatasourceKey + ".disable"
	MySQLDatasourceOrder      = 20
)
View Source
const (
	OssKey               = "oss"
	OssDisableKey        = OssKey + ".disable"
	OssEndpointKey       = OssKey + ".endpoint"
	OssAkKey             = OssKey + ".ak"
	OssSkKey             = OssKey + ".sk"
	OssRegionKey         = OssKey + ".region"
	OssDdisableSSLKey    = OssKey + ".disable-ssl"
	OssForcePathStyleKey = OssKey + ".force-path-style"

	OssOrder = 40
)
View Source
const (
	RedisKey             = "redis"
	RedisDisableKey      = RedisKey + ".disable"
	RedisAddrKey         = RedisKey + ".addr"
	RedisPasswordKey     = RedisKey + ".password"
	RedisDBKey           = RedisKey + ".db"
	RedisPoolSizeKey     = RedisKey + ".poolSize"
	RedisMaxIdleKey      = RedisKey + ".maxIdle"
	RedisDialTimeoutKey  = RedisKey + ".dialTimeout"
	RedisReadTimeoutKey  = RedisKey + ".readTimeout"
	RedisWriteTimeoutKey = RedisKey + ".writeTimeout"
	RedisDatasourceOrder = 30
)
View Source
const (
	ZookeeperKey               = "zookeeper"
	ZookeeperDisableKey        = ZookeeperKey + ".disable"
	ZookeeperServersKey        = ZookeeperKey + ".servers"
	ZookeepersessionTimeoutKey = ZookeeperKey + ".sessionTimeout"
	ZookeeperOrder             = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoCipher added in v1.3.1

type AutoCipher struct {
	Conf config.TypedConfig `@siu:"name='environment',default='type'"`
	// contains filtered or unexported fields
}

func (*AutoCipher) Condition added in v1.3.1

func (p *AutoCipher) Condition() bool

func (*AutoCipher) Name added in v1.3.1

func (*AutoCipher) Name() string

func (*AutoCipher) Named added in v1.3.1

func (p *AutoCipher) Named() map[string]interface{}

func (*AutoCipher) OnStart added in v1.3.1

func (p *AutoCipher) OnStart() error

func (*AutoCipher) OnStop added in v1.3.1

func (p *AutoCipher) OnStop() error

func (*AutoCipher) Order added in v1.3.1

func (*AutoCipher) Order() int

func (*AutoCipher) Typed added in v1.3.1

func (p *AutoCipher) Typed() map[reflect.Type]interface{}

type AutoGorm added in v1.3.0

type AutoGorm struct {
	Conf   config.TypedConfig `@siu:"name='environment',default='type'"`
	Logger interfaces.Logger  `@siu:"name='logger',default='type'"`
	// contains filtered or unexported fields
}

func (*AutoGorm) Condition added in v1.3.0

func (p *AutoGorm) Condition() bool

func (*AutoGorm) Name added in v1.3.0

func (*AutoGorm) Name() string

func (*AutoGorm) Named added in v1.3.0

func (p *AutoGorm) Named() map[string]interface{}

func (*AutoGorm) OnStart added in v1.3.0

func (p *AutoGorm) OnStart() error

func (*AutoGorm) OnStop added in v1.3.0

func (p *AutoGorm) OnStop() error

func (*AutoGorm) Order added in v1.3.0

func (*AutoGorm) Order() int

func (*AutoGorm) Typed added in v1.3.0

func (p *AutoGorm) Typed() map[reflect.Type]interface{}

type AutoMysql

type AutoMysql struct {
	Conf config.TypedConfig `@siu:"name='environment',default='type'"`
	// contains filtered or unexported fields
}

func (*AutoMysql) Condition

func (p *AutoMysql) Condition() bool

func (*AutoMysql) Name

func (*AutoMysql) Name() string

func (*AutoMysql) Named added in v1.1.0

func (p *AutoMysql) Named() map[string]interface{}

func (*AutoMysql) OnStart

func (p *AutoMysql) OnStart() error

func (*AutoMysql) OnStop

func (p *AutoMysql) OnStop() error

func (*AutoMysql) Order

func (*AutoMysql) Order() int

func (*AutoMysql) Typed added in v1.1.0

func (p *AutoMysql) Typed() map[reflect.Type]interface{}

type AutoOss added in v1.3.1

type AutoOss struct {
	Conf config.TypedConfig `@siu:"name='environment',default='type'"`
	// contains filtered or unexported fields
}

func (*AutoOss) Condition added in v1.3.1

func (p *AutoOss) Condition() bool

func (*AutoOss) Name added in v1.3.1

func (*AutoOss) Name() string

func (*AutoOss) Named added in v1.3.1

func (p *AutoOss) Named() map[string]interface{}

func (*AutoOss) OnStart added in v1.3.1

func (p *AutoOss) OnStart() error

func (*AutoOss) OnStop added in v1.3.1

func (p *AutoOss) OnStop() error

func (*AutoOss) Order added in v1.3.1

func (*AutoOss) Order() int

func (*AutoOss) Typed added in v1.3.1

func (p *AutoOss) Typed() map[reflect.Type]interface{}

type AutoRedis

type AutoRedis struct {
	Conf config.TypedConfig `@siu:"name='environment',default='type'"`
	// contains filtered or unexported fields
}

func (*AutoRedis) Condition

func (p *AutoRedis) Condition() bool

func (*AutoRedis) Name

func (*AutoRedis) Name() string

func (*AutoRedis) Named added in v1.1.0

func (p *AutoRedis) Named() map[string]interface{}

func (*AutoRedis) OnStart

func (p *AutoRedis) OnStart() error

func (*AutoRedis) OnStop

func (p *AutoRedis) OnStop() error

func (*AutoRedis) Order

func (*AutoRedis) Order() int

func (*AutoRedis) Typed added in v1.1.0

func (p *AutoRedis) Typed() map[reflect.Type]interface{}

type AutoZookeeper

type AutoZookeeper struct {
	Conf config.TypedConfig `@siu:"name='environment',default='type'"`
	// contains filtered or unexported fields
}

func (*AutoZookeeper) Condition

func (p *AutoZookeeper) Condition() bool

func (*AutoZookeeper) Name

func (*AutoZookeeper) Name() string

func (*AutoZookeeper) Named added in v1.1.0

func (p *AutoZookeeper) Named() map[string]interface{}

func (*AutoZookeeper) OnStart

func (p *AutoZookeeper) OnStart() error

func (*AutoZookeeper) OnStop

func (p *AutoZookeeper) OnStop() error

func (*AutoZookeeper) Order

func (*AutoZookeeper) Order() int

func (*AutoZookeeper) Typed added in v1.1.0

func (p *AutoZookeeper) Typed() map[reflect.Type]interface{}

type CipherImpl added in v1.3.1

type CipherImpl struct {
	Key        []byte
	HmacKey    []byte
	PublicKey  string
	PrivateKey *rsa.PrivateKey
}

func NewCipherImpl added in v1.3.1

func NewCipherImpl(skey string, shmacKey string, spublicKey string, sprivateKey string) (*CipherImpl, error)

func (*CipherImpl) Decrypt added in v1.3.1

func (p *CipherImpl) Decrypt(s string) (string, error)

func (*CipherImpl) Encrypt added in v1.3.1

func (p *CipherImpl) Encrypt(s string) string

func (*CipherImpl) GenRsaKeyPair added in v1.3.1

func (p *CipherImpl) GenRsaKeyPair(length int) (string, string)

func (*CipherImpl) GetPublickey added in v1.3.1

func (p *CipherImpl) GetPublickey() string

func (*CipherImpl) Hash added in v1.3.1

func (p *CipherImpl) Hash(s string) string

func (*CipherImpl) Hmac added in v1.3.1

func (p *CipherImpl) Hmac(s string) string

func (*CipherImpl) PrivateKeyDecrypt added in v1.3.1

func (p *CipherImpl) PrivateKeyDecrypt(s string) (string, error)

func (*CipherImpl) PublickeyEncrypt added in v1.3.1

func (p *CipherImpl) PublickeyEncrypt(s string) string

func (*CipherImpl) Random added in v1.3.1

func (p *CipherImpl) Random(n int) []byte

func (*CipherImpl) Sign added in v1.3.1

func (p *CipherImpl) Sign(msg string) string

func (*CipherImpl) Verify added in v1.3.1

func (p *CipherImpl) Verify(msg string, sign string) bool

type Logger added in v1.3.0

type Logger struct {
	// contains filtered or unexported fields
}

func (*Logger) Error added in v1.3.0

func (p *Logger) Error(ctx context.Context, format string, args ...interface{})

func (*Logger) Info added in v1.3.0

func (p *Logger) Info(ctx context.Context, format string, args ...interface{})

func (*Logger) LogMode added in v1.3.0

func (p *Logger) LogMode(level logger.LogLevel) logger.Interface

func (*Logger) Trace added in v1.3.0

func (p *Logger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*Logger) Warn added in v1.3.0

func (p *Logger) Warn(ctx context.Context, format string, args ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳