models

package
v0.0.0-...-99505da Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(auth Pms_Auth) error

新建api调用账户

func CheckAuth

func CheckAuth(username, password string) bool

检查用户密码是否一致

func CloseDB

func CloseDB()

func CreateTable

func CreateTable()

创建表

func DelUser

func DelUser(auth Pms_Auth) error

删除api调用账户

func GenPwdIPs

func GenPwdIPs(ips string) (changeList, NotExist []string)

指定ip生成密码

func GetIpsPwd

func GetIpsPwd(ips string) (results []map[string]string)

获取指定ip的密码

func InitData

func InitData()

添加初始化数据

func UpdateIPPasswd

func UpdateIPPasswd()

更新密码表的信息

Types

type IPAssets

type IPAssets struct {
	gorm.Model
	LanIP  string `gorm:"primary_key"`
	WanIP  string
	BisId  string
	Module string
}

IP资产表

type IPPasswd

type IPPasswd struct {
	gorm.Model
	User    string `gorm:"primary_key"`
	Passwds string
	AssetId uint
}

ip与密码对应表

type Pms_Auth

type Pms_Auth struct {
	ID       int    `gorm:"primary_key" json:"id"`
	Username string `gorm:"primary_key" json:"username"`
	Password string `json:"password"`
}

api账户表

type Recrod

type Recrod struct {
	ID       uint `gorm:"primary_key"`
	Exectype string
	Username string
	Params   string
	Rst      string
}

操作记录表

type SearchPwd

type SearchPwd struct {
	LanIp string
	IPPasswd
}

查询结果

func GetIpsInfo

func GetIpsInfo(ips string) (results []SearchPwd)

获取数据库中的ip的信息

Jump to

Keyboard shortcuts

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