rpwd

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccMySQL      = "mysql"
	AccRedis      = "redis"
	AccMongoDB    = "mongo_db"
	AccSQLite     = "sqlite"
	AccOracle     = "oracle"
	AccSQLServer  = "sql_server"
	AccMariaDB    = "maria_db"
	AccPostgreSQL = "postgre_sql"
)
View Source
const (
	KeyJwtSecretKey = "jwt_secret_key" //jwt密钥
	KeyPwdSecretKey = "pwd_secret_key" //密码加密密钥
)

Variables

This section is empty.

Functions

func AutoSavePasswordFile

func AutoSavePasswordFile(filepath string, accPwd map[string]AccountAndPassword, keys map[string]string, other map[string]any) error

AutoSavePasswordFile 自动保存password文件,如果原来的里面有的key,则不作任何改动;不存在的key则新增。

func GetKey

func GetKey(key string) (string, error)

GetKey 获取指定key的值

func GetOther

func GetOther(key string) (any, error)

GetOther 获取指定key的值

func InitCreatePasswordFile added in v0.0.49

func InitCreatePasswordFile(filepath string)

InitCreatePasswordFile 初始化创建一个password文件。

func LoadPasswordFile

func LoadPasswordFile(filepath string) error

LoadPasswordFile 加载password文件

Types

type AccountAndPassword

type AccountAndPassword struct {
	IP       string `json:"ip"`       //IP
	Port     uint   `json:"port"`     //端口
	Account  string `json:"account"`  //账号
	Password string `json:"password"` //密码
	Other    string `json:"other"`    //其它
}

func GetAccountAndPassword

func GetAccountAndPassword(name string) (AccountAndPassword, error)

GetAccountAndPassword 获取指定name的账号和密码信息

Jump to

Keyboard shortcuts

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