Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypePassword = "password" TypeSSHKey = "ssh_key" )
凭证类型常量
View Source
const ( KeyTypeRSA = "rsa" KeyTypeED25519 = "ed25519" KeyTypeECDSA = "ecdsa" )
SSH 密钥类型常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
ID int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"`
Type string `gorm:"column:type;type:varchar(50);not null" json:"type"` // "password" | "ssh_key"
Username string `gorm:"column:username;type:varchar(255)" json:"username,omitempty"`
Password string `gorm:"column:password;type:text" json:"-"` // 加密后的密码(type=password)
PrivateKey string `gorm:"column:private_key;type:text" json:"-"` // 加密后的私钥(type=ssh_key)
Passphrase string `gorm:"column:passphrase;type:text" json:"-"` // 加密后的私钥密码(type=ssh_key)
PublicKey string `gorm:"column:public_key;type:text" json:"publicKey,omitempty"`
KeyType string `gorm:"column:key_type;type:varchar(50)" json:"keyType,omitempty"` // rsa/ed25519/ecdsa
KeySize int `gorm:"column:key_size" json:"keySize,omitempty"`
Fingerprint string `gorm:"column:fingerprint;type:varchar(255)" json:"fingerprint,omitempty"`
Comment string `gorm:"column:comment;type:varchar(255)" json:"comment,omitempty"`
Description string `gorm:"column:description;type:text" json:"description,omitempty"`
Createtime int64 `gorm:"column:createtime" json:"createtime"`
Updatetime int64 `gorm:"column:updatetime" json:"updatetime"`
}
Credential 统一凭证实体
Click to show internal directories.
Click to hide internal directories.