lms_db

package
v0.0.0-...-3a41573 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Types

type LMSPackage

type LMSPackage lms_rest.LMSPackage

func (*LMSPackage) Scan

func (m *LMSPackage) Scan(value interface{}) error

func (LMSPackage) Value

func (m LMSPackage) Value() (driver.Value, error)

type LMSPackageDB

type LMSPackageDB struct {
	gorm.Model
	Description string     `gorm:"type:text" json:"description"`
	ImportedAt  time.Time  `json:"imported_at"`
	PackageID   string     `json:"package_id"`
	BlockID     string     `json:"block_id"`
	Package     LMSPackage `gorm:"type:JSON" json:"package"`
}

func (LMSPackageDB) TableName

func (l LMSPackageDB) TableName() string

func (*LMSPackageDB) ValidFoundationBlockTime

func (l *LMSPackageDB) ValidFoundationBlockTime(db *gorm.DB, createAt time.Time) bool

type LMSSubPackage

type LMSSubPackage lms_rest.SubPackage

func (*LMSSubPackage) Scan

func (m *LMSSubPackage) Scan(value interface{}) error

func (LMSSubPackage) Value

func (m LMSSubPackage) Value() (driver.Value, error)

type LMSSubPackageDB

type LMSSubPackageDB struct {
	gorm.Model
	Description string        `gorm:"type:text" json:"description"`
	ImportedAt  time.Time     `json:"imported_at"`
	PackageID   string        `json:"package_id"`
	BlockID     string        `json:"block_id"`
	Package     LMSSubPackage `gorm:"type:JSON" json:"package"`
}

func (LMSSubPackageDB) TableName

func (l LMSSubPackageDB) TableName() string

占用和LMSPackageDB一样的表名, 因为这两个在不同的数据库中

type License

type License struct {
	gorm.Model
	// 授权分配时间
	AssignedAt string `json:"assigned_at,omitempty" yaml:"assigned_at,omitempty"`

	// 组件id
	ComponentId string `json:"component_id,omitempty" yaml:"component_id,omitempty"`

	// 组件ip
	ComponentIp string `json:"component_ip,omitempty" yaml:"component_ip,omitempty"`

	// 组件名称
	ComponentName string `json:"component_name,omitempty" yaml:"component_name,omitempty"`

	// 组件类型,Firewall,Waf,DBAudit,...
	ComponentType string `json:"component_type,omitempty" yaml:"component_type,omitempty"`

	// 授权到期时间
	ExpiredAt string `json:"expired_at,omitempty" yaml:"expired_at,omitempty"`

	// 授权对应的唯一uuid
	LicenseId string `json:"license_id,omitempty" yaml:"license_id,omitempty"`

	// MonthSigns corresponds to the JSON schema field "month_signs".
	MonthSigns []MonthSign `gorm:"type:JSON" json:"month_signs,omitempty" yaml:"month_signs,omitempty"`

	// 授权分配者
	Signer string `json:"signer,omitempty" yaml:"signer,omitempty"`

	// 规格
	Spec string `json:"spec,omitempty" yaml:"spec,omitempty"`
}

type LicenseCount

type LicenseCount struct {
	gorm.Model
	Assigned        int    `json:"assigned,omitempty" yaml:"assigned,omitempty"`
	Available       int    `json:"available,omitempty" yaml:"available,omitempty"`
	Expired         int    `json:"expired,omitempty" yaml:"expired,omitempty"`
	ExpiredIn2Month int    `json:"expired_in_2_month,omitempty" yaml:"expired_in_2_month,omitempty"`
	Failed          int    `json:"failed,omitempty" yaml:"failed,omitempty"`
	Reverted        int    `json:"reverted,omitempty" yaml:"reverted,omitempty"`
	Signer          string `json:"signer,omitempty" yaml:"signer,omitempty"`
	SignerType      string `json:"signer_type,omitempty"`
	Total           int    `json:"total,omitempty" yaml:"total,omitempty"`
}

type LicenseCounts

type LicenseCounts []LicenseCount

func (LicenseCounts) Copy

func (cs LicenseCounts) Copy(cb func(LicenseCount))

func (LicenseCounts) Sum

func (cs LicenseCounts) Sum() LicenseCount

type MonthSign

type MonthSign struct {
	// 签名内容
	Sign string `json:"sign,omitempty" yaml:"sign,omitempty"`

	// 签名时间
	SignedAt string `json:"signed_at,omitempty" yaml:"signed_at,omitempty"`
}

func (*MonthSign) Scan

func (m *MonthSign) Scan(value interface{}) error

func (MonthSign) Value

func (m MonthSign) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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