models

package
v0.0.70 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 17 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.Item, error)

type Cluster

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

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

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

func (Cluster) ClusterConfig

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

func (Cluster) PrettyYaml added in v0.0.70

func (c Cluster) PrettyYaml() string

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()

type State added in v0.0.28

type State uint8

type UserPermission added in v0.0.28

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

	Username    string          `json:"username"`
	Email       string          `json:"email" gorm:"not null;index;"`
	Permission  rbac.Permission `json:"permission" gorm:"index;"`
	SubjectID   int64           `json:"subject_id"`
	State       rbac.State      `json:"state" gorm:"index;"`
	Reason      string          `json:"reason"`
	Description string          `json:"description"`

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

func (*UserPermission) ProtoTransform added in v0.0.28

func (p *UserPermission) ProtoTransform() *rbac.UserPermission

Jump to

Keyboard shortcuts

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