db

package
v0.0.0-...-2119b44 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVNodeRepo

func NewVNodeRepo(db sql.Db) *vNodeRepo

Types

type VNode

type VNode struct {
	gorm.Model
	NodeID string `gorm:"unique;type:string;size:23;expression:lower(node_id);size:32;not null" json:"nodeID"`
	Status string `gorm:"size:32;not null" json:"status"`
}

type VNodeRepo

type VNodeRepo interface {
	Insert(nodeId string, status string) error
	Update(nodeId string, status string) error
	PowerOn(nodeId string) error
	PowerOff(nodeId string) error
	GetInfo(nodeId string) (*VNode, error)
	List() (*[]VNode, error)
	Delete(nodeId string) error
}

type VNodeStatus

type VNodeStatus string
const (
	VNodePreCheck VNodeStatus = "PreCheck"
	VNodeOn       VNodeStatus = "PowerOn"
	VNodeOff      VNodeStatus = "PowerOff"
)

func VNodeState

func VNodeState(s string) (*VNodeStatus, error)

func (VNodeStatus) String

func (s VNodeStatus) String() string

Jump to

Keyboard shortcuts

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