data

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *gorm.DB

Functions

func AddSecret

func AddSecret(username string, name, Id, Secret string) error

func BanUser

func BanUser(Username string) error

func ChangePassword

func ChangePassword(username string, OldPasswordMd5, NewPasswordMd5 string) error

func ChangeUsername

func ChangeUsername(OldUsername, NewUsername, Password string) error

func CreateAdminUser

func CreateAdminUser()

func DbInit

func DbInit(path string) error

func DelSecret

func DelSecret(username string, name string) error

func DeleteUser

func DeleteUser(Username string) error

func IsAdmin

func IsAdmin(Username string) bool

func IsEmailVerity

func IsEmailVerity() bool

func LoginVerify

func LoginVerify(Username string, PasswordMd5 string) error

func Register

func Register(Username, Email, PasswordMd5 string) error

func SaveMailConfig

func SaveMailConfig(host, email, password string, enable, port int)

func UnBanUser

func UnBanUser(Username string) error

Types

type AwsSecret

type AwsSecret struct {
	gorm.Model
	UserId   string
	Name     string
	SecretId string
	Secret   string
}

func GetSecret

func GetSecret(username string, name string) (*AwsSecret, error)

func ListSecret

func ListSecret(username string) ([]AwsSecret, error)

type Config

type Config struct {
	gorm.Model
	EmailVerity int // 0 off,1 on
	MailHost    string
	Port        int
	Email       string
	Password    string
}

func GetMailConfig

func GetMailConfig() *Config

type UserData

type UserData struct {
	gorm.Model
	Status   int    `gorm:"Status"` //0 正常,1 封禁
	Username string `gorm:"Username"`
	Email    string `gorm:"Email"`
	Password string `gorm:"Password"`
	IsAdmin  int    `gorm:"IsAdmin"` //0 否,1 是
}

type UserInfo

type UserInfo struct {
	UserName string
	Status   int
	IsAdmin  int
}

func GetUserList

func GetUserList() ([]UserInfo, error)

Jump to

Keyboard shortcuts

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