model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Types

type DBMng

type DBMng struct {
	// contains filtered or unexported fields
}
var DB *DBMng

DB is a global db manager

func InitDB

func InitDB(dbConf *configs.DBConfig) (*DBMng, error)

func NewDBMng

func NewDBMng(db *gorm.DB) *DBMng

func (*DBMng) CreateInstance

func (m *DBMng) CreateInstance(ins *types.Instance) error

func (*DBMng) DeleteInstance

func (m *DBMng) DeleteInstance(insName string) error

func (*DBMng) GetInstance

func (m *DBMng) GetInstance(hostID, name string) (*types.Instance, error)

func (*DBMng) UpdateInstanceImage

func (m *DBMng) UpdateInstanceImage(name, image string) error

func (*DBMng) UpdateInstanceStatus

func (m *DBMng) UpdateInstanceStatus(name string, status bool) error

Jump to

Keyboard shortcuts

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