db

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DBPath = "./main.db"

Variables

This section is empty.

Functions

func AddDBGroup

func AddDBGroup(data Group) bool

groupdata

func AddDBNode

func AddDBNode(data Node) bool

Node

func AddDBUser

func AddDBUser(data User) bool

userdata

func ChangeDBGroupAdmin

func ChangeDBGroupAdmin(id int, data string) bool

func ChangeDBGroupName

func ChangeDBGroupName(id int, data string) bool

func ChangeDBGroupUser

func ChangeDBGroupUser(id int, data string) bool

func ChangeDBUserName

func ChangeDBUserName(id int, data string) bool

func ChangeDBUserPassword

func ChangeDBUserPassword(id int, data string) bool

func GetDBGroupID

func GetDBGroupID(name string) (int, bool)

func GetDBUserID

func GetDBUserID(name string) (int, bool)

func InitDB

func InitDB() bool

func NodeDBStatusUpdate

func NodeDBStatusUpdate(id, status int) bool

func PassAuthDBUser

func PassAuthDBUser(name, pass string) bool

func RemoveDBGroup

func RemoveDBGroup(id int) bool

func RemoveDBNode

func RemoveDBNode(id int) bool

func RemoveDBUser

func RemoveDBUser(name string) bool

Types

type Group

type Group struct {
	ID         int
	Name       string
	Admin      string
	User       string
	MaxVM      int
	MaxCPU     int
	MaxMem     int
	MaxStorage int
	Net        string
}

func GetDBAllGroup

func GetDBAllGroup() []Group

func GetDBGroup

func GetDBGroup(id int) (Group, bool)

type Node

type Node struct {
	ID        int
	HostName  string
	IP        string
	Path      string
	OnlyAdmin int
	MaxCPU    int
	MaxMem    int
	Status    int
}

func GetDBAllNode

func GetDBAllNode() []Node

func GetDBNodeID

func GetDBNodeID(id int) (Node, bool)

type User

type User struct {
	ID   int
	Name string
	Pass string
	Auth int
}

func GetDBAllUser

func GetDBAllUser() []User

Jump to

Keyboard shortcuts

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