viperx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetViper

func GetViper(name, filetype string) *viper.Viper

GetViper 获取viper配置 name: 配置文件名,不带后缀 filetype: 配置文件类型,如json、yaml、ini等

func ReadFile

func ReadFile(name, filetype string) ([]byte, error)

func RegisterConfigEncryptor

func RegisterConfigEncryptor(h ConfigFileEncryptorHook)

RegisterConfigEncryptor 注册配置文件加密器

Types

type ConfigFileEncryptorHook

type ConfigFileEncryptorHook interface {
	IsCipherText([]byte) bool
	Encrypt([]byte) []byte
	Decrypt([]byte) []byte
}

ConfigFileEncryptorHook 配置文件加密器

Jump to

Keyboard shortcuts

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