Documentation
¶
Index ¶
- Constants
- Variables
- func FullVersion() string
- func Short() string
- type Application
- func (i *Application) DecryptByte(ciphertext []byte) ([]byte, error)
- func (i *Application) DecryptString(ciphertext string) (string, error)
- func (i *Application) Domain() string
- func (i *Application) EncryptByte(plaintext []byte) ([]byte, error)
- func (i *Application) EncryptString(plaintext string) (string, error)
- func (i *Application) GenerateRandomEncryptKey() string
- func (i *Application) GetAppName() string
- func (i *Application) GetExtras(key string) string
- func (i *Application) GetKeyInfo() (map[string]any, error)
- func (i *Application) Host() string
- func (i *Application) Init() error
- func (i *Application) IsInternalIP() bool
- func (i *Application) Name() string
- func (i *Application) Priority() int
- type EncryptAlgorithm
Constants ¶
View Source
const (
AppName = "app"
)
Variables ¶
View Source
var ( GIT_TAG string GIT_COMMIT string GIT_BRANCH string BUILD_TIME string GO_VERSION string )
编译时注入
Functions ¶
Types ¶
type Application ¶
type Application struct {
ioc.ObjectImpl
AppGroup string `json:"group" yaml:"group" toml:"group" env:"GROUP"`
AppName string `json:"name" yaml:"name" toml:"name" env:"NAME"`
AppDescription string `json:"description" yaml:"description" toml:"description" env:"DESCRIPTION"`
AppAddress string `json:"address" yaml:"address" toml:"address" env:"ADDRESS"`
Debug bool `json:"debug" yaml:"debug" toml:"debug" env:"DEBUG"`
InternalAddress string `json:"internal_address" yaml:"internal_address" toml:"internal_address" env:"INTERNAL_ADDRESS"`
InternalToken string `json:"internal_token" yaml:"internal_token" toml:"internal_token" env:"INTERNAL_TOKEN"`
EncryptAlgorithm EncryptAlgorithm `json:"encrypt_algorithm" yaml:"encrypt_algorithm" toml:"encrypt_algorithm" env:"ENCRYPT_ALGORITHM"`
KeyLength aesgcm.KeySize `json:"key_length" yaml:"key_length" toml:"key_length" env:"KEY_LENGTH"`
EncryptKey string `json:"encrypt_key" yaml:"encrypt_key" toml:"encrypt_key" env:"ENCRYPT_KEY"`
CipherPrefix string `json:"cipher_prefix" yaml:"cipher_prefix" toml:"cipher_prefix" env:"CIPHER_PREFIX"`
Extras map[string]string `json:"extras" yaml:"extras" toml:"extras" env:"EXTRAS"`
// contains filtered or unexported fields
}
func Get ¶ added in v2.0.3
func Get() *Application
func (*Application) DecryptByte ¶ added in v2.0.88
func (i *Application) DecryptByte(ciphertext []byte) ([]byte, error)
func (*Application) DecryptString ¶ added in v2.0.88
func (i *Application) DecryptString(ciphertext string) (string, error)
func (*Application) Domain ¶ added in v2.0.8
func (i *Application) Domain() string
func (*Application) EncryptByte ¶ added in v2.0.88
func (i *Application) EncryptByte(plaintext []byte) ([]byte, error)
func (*Application) EncryptString ¶ added in v2.0.88
func (i *Application) EncryptString(plaintext string) (string, error)
func (*Application) GenerateRandomEncryptKey ¶ added in v2.0.88
func (i *Application) GenerateRandomEncryptKey() string
func (*Application) GetAppName ¶ added in v2.0.31
func (i *Application) GetAppName() string
func (*Application) GetExtras ¶ added in v2.0.52
func (i *Application) GetExtras(key string) string
func (*Application) GetKeyInfo ¶ added in v2.0.88
func (i *Application) GetKeyInfo() (map[string]any, error)
func (*Application) Host ¶ added in v2.0.40
func (i *Application) Host() string
func (*Application) Init ¶
func (i *Application) Init() error
func (*Application) IsInternalIP ¶ added in v2.0.13
func (i *Application) IsInternalIP() bool
func (*Application) Name ¶
func (i *Application) Name() string
type EncryptAlgorithm ¶ added in v2.0.88
type EncryptAlgorithm string
加密算法
const ( // AES-GCM ENCRYPT_ALGORITHM_AES_GCM EncryptAlgorithm = "AES-GCM" // AES-CBC ENCRYPT_ALGORITHM_AES_CBC EncryptAlgorithm = "AES-CBC" )
Click to show internal directories.
Click to hide internal directories.