Documentation
¶
Index ¶
- Constants
- type AutoCipher
- type AutoGorm
- type AutoMysql
- type AutoOss
- type AutoRedis
- type AutoZookeeper
- func (p *AutoZookeeper) Condition() bool
- func (*AutoZookeeper) Name() string
- func (p *AutoZookeeper) Named() map[string]interface{}
- func (p *AutoZookeeper) OnStart() error
- func (p *AutoZookeeper) OnStop() error
- func (*AutoZookeeper) Order() int
- func (p *AutoZookeeper) Typed() map[reflect.Type]interface{}
- type CipherImpl
- func (p *CipherImpl) Decrypt(s string) (string, error)
- func (p *CipherImpl) Encrypt(s string) string
- func (p *CipherImpl) GenRsaKeyPair(length int) (string, string)
- func (p *CipherImpl) GetPublickey() string
- func (p *CipherImpl) Hash(s string) string
- func (p *CipherImpl) Hmac(s string) string
- func (p *CipherImpl) PrivateKeyDecrypt(s string) (string, error)
- func (p *CipherImpl) PublickeyEncrypt(s string) string
- func (p *CipherImpl) Random(n int) []byte
- func (p *CipherImpl) Sign(msg string) string
- func (p *CipherImpl) Verify(msg string, sign string) bool
- type Logger
- func (p *Logger) Error(ctx context.Context, format string, args ...interface{})
- func (p *Logger) Info(ctx context.Context, format string, args ...interface{})
- func (p *Logger) LogMode(level logger.LogLevel) logger.Interface
- func (p *Logger) Trace(ctx context.Context, begin time.Time, ...)
- func (p *Logger) Warn(ctx context.Context, format string, args ...interface{})
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 }
type AutoMysql ¶
type AutoMysql struct { Conf config.TypedConfig `@siu:"name='environment',default='type'"` // contains filtered or unexported fields }
type AutoOss ¶ added in v1.3.1
type AutoOss struct { Conf config.TypedConfig `@siu:"name='environment',default='type'"` // contains filtered or unexported fields }
type AutoRedis ¶
type AutoRedis struct { Conf config.TypedConfig `@siu:"name='environment',default='type'"` // contains filtered or unexported fields }
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 (*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
Click to show internal directories.
Click to hide internal directories.