models

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	ID int `json:"id" gorm:"primaryKey;"`

	Type      string `json:"type" gorm:"size:50;not null;default:''"`
	Namespace string `json:"namespace" gorm:"size:50;not null;default:''"`
	Name      string `json:"name" gorm:"size:255;not null;default:''"`
	ClusterID int    `json:"cluster_id" gorm:"index;not null;default:0"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`

	Cluster Cluster
}

func (Card) GetItems

func (c Card) GetItems() ([]*cc.ContainerItem, error)

type Cluster

type Cluster struct {
	ID int `json:"id" gorm:"primaryKey;"`

	Name       string `json:"key" gorm:"size:255;not null;default:'';"`
	KubeConfig string `json:"kube_config" gorm:"type:text"`
	Namespace  string `json:"namespace" gorm:"size:70;not null;default:''"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

func (Cluster) ClusterConfig

func (c Cluster) ClusterConfig() *restclient.Config

type Event

type Event struct {
	ID int `json:"id" gorm:"primaryKey;"`

	Action   uint8  `json:"action" gorm:"type:tinyint;not null;default:0;"`
	Username string `json:"username" gorm:"size:255;not null;default:'';"`
	Message  string `json:"message" gorm:"size:255;not null;default:'';"`

	Old      string `json:"old" gorm:"type:text;"`
	New      string `json:"new" gorm:"type:text;"`
	Duration string `json:"duration" gorm:"not null;default:''"`

	FileID *int `json:"file_id" gorm:"nullable;"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`

	File *File
}

type File

type File struct {
	ID int `json:"id" gorm:"primaryKey;"`

	Path     string `json:"path" gorm:"size:255;not null;"`
	Size     uint64 `json:"size" gorm:"not null;default:0;"`
	Username string `json:"username" gorm:"size:255;not null;default:'';"`

	ClusterID     int    `json:"cluster_id" gorm:"not null;default:0;"`
	Namespace     string `json:"namespace" gorm:"size:100;not null;default:'';"`
	Pod           string `json:"pod" gorm:"size:100;not null;default:'';"`
	Container     string `json:"container" gorm:"size:100;not null;default:'';"`
	ContainerPath string `json:"container_path" gorm:"size:255;not null;default:'';"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

func (*File) DeleteFile

func (f *File) DeleteFile()

Jump to

Keyboard shortcuts

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