Documentation ¶
Index ¶
- func DeleteCluster(db *sql.DB, id string) error
- func DeleteNode(db *sql.DB, id string) error
- func GenerateID() string
- func GetDB() *sql.DB
- func InitializeDB() error
- func InsertCluster(db *sql.DB, cluster K3sCluster) error
- func InsertNode(db *sql.DB, node K3sNode) error
- func UpdateCluster(db *sql.DB, cluster K3sCluster) error
- func UpdateNode(db *sql.DB, node K3sNode) error
- type K3sCluster
- type K3sNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCluster ¶
DeleteCluster deletes a cluster from the database
func DeleteNode ¶
DeleteNode deletes a node from the database
func InsertCluster ¶
func InsertCluster(db *sql.DB, cluster K3sCluster) error
InsertCluster inserts a new cluster into the database
func InsertNode ¶
InsertNode inserts a new node into the database
func UpdateCluster ¶
func UpdateCluster(db *sql.DB, cluster K3sCluster) error
UpdateCluster updates a cluster in the database
Types ¶
type K3sCluster ¶
type K3sCluster struct { CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` ID string `json:"id"` // Last 12 characters of UUID Status string `json:"status"` Version string `json:"version"` Apiserver string `json:"apiserver"` IsHA bool `json:"is_ha"` // Indicates high availability }
K3sCluster represents a K3s cluster
func SelectCluster ¶
func SelectCluster(db *sql.DB, id string) (*K3sCluster, error)
SelectCluster selects a cluster from the database by ID
func SelectClusters ¶
func SelectClusters(db *sql.DB) ([]K3sCluster, error)
SelectClusters selects all clusters from the database
type K3sNode ¶
type K3sNode struct { CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` ID string `json:"id"` ClusterID string `json:"cluster_id"` IP string `json:"ip"` Role string `json:"role"` // Can be "server" or "agent" Status string `json:"status"` }
K3sNode represents a K3s node
func SelectNode ¶
SelectNode selects a node from the database by ID
func SelectNodeByIP ¶
SelectNodeByIP selects a node from the database by IP
func SelectNodes ¶
SelectNodes selects all nodes from the database
Click to show internal directories.
Click to hide internal directories.