entity

package
v0.0.0-...-f5cfa87 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package entity storage entity

Index

Constants

View Source
const (
	FieldKeyObjectID           = "_id"
	FieldKeyProjectID          = "projectID"
	FieldKeyProjectCode        = "projectCode"
	FieldKeyClusterID          = "clusterID"
	FieldKeyRule               = "rule"
	FieldKeyName               = "name"
	FieldKeyRuleID             = "ruleID"
	FieldKeyRuleName           = "ruleName"
	FieldKeyStatus             = "status"
	FieldKeyMessage            = "message"
	FieldKeyFileIndexSetID     = "fileIndexSetID"
	FieldKeyStdIndexSetID      = "stdIndexSetID"
	FieldKeyRuleFileIndexSetID = "ruleFileIndexSetID"
	FieldKeyRuleStdIndexSetID  = "ruleSTDIndexSetID"
	FieldKeyFromRuleID         = "fromRule"

	FieldKeyCreator   = "creator"
	FieldKeyUpdator   = "updator"
	FieldKeyCreatedAt = "createdAt"
	FieldKeyUpdatedAt = "updatedAt"
)

定义一批统一的key, 用在db相关的字段

View Source
const (
	// PendingStatus rule pending status
	PendingStatus = "PENDING"
	// RunningStatus rule running status
	RunningStatus = "RUNNING"
	// FailedStatus rule fail status
	FailedStatus = "FAILED"
	// SuccessStatus rule success status
	SuccessStatus = "SUCCESS"
	// TerminatedStatus rule terminated status
	TerminatedStatus = "TERMINATED"
	// DeletedStatus rule deleted status
	DeletedStatus = "DELETED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogIndex

type LogIndex struct {
	ProjectID      string `json:"project_id" bson:"projectID" gorm:"column:project_id"`
	BizID          int    `json:"biz_id" bson:"bizID" gorm:"column:cc_app_id"`
	STDDataID      int    `json:"std_data_id" bson:"stdDataID" gorm:"column:std_data_id"`
	FileDataID     int    `json:"file_data_id" bson:"fileDataID" gorm:"column:file_data_id"`
	STDIndexSetID  int    `json:"std_index_set_id" bson:"stdIndexSetID" gorm:"column:std_index_set_id"`
	FileIndexSetID int    `json:"file_index_set_id" bson:"fileIndexSetID" gorm:"column:file_index_set_id"`
}

LogIndex for log index

func (LogIndex) TableName

func (LogIndex) TableName() string

TableName return log index table name

type LogRule

type LogRule struct {
	ID                 primitive.ObjectID `json:"id" bson:"_id"`
	DisplayName        string             `json:"display_name" bson:"displayName"`
	Name               string             `json:"name" bson:"name"`
	RuleName           string             `json:"rule_name" bson:"ruleName"`
	RuleID             int                `json:"rule_id" bson:"ruleID"`
	Description        string             `json:"description" bson:"description"`
	ProjectID          string             `json:"project_id" bson:"projectID"`
	ProjectCode        string             `json:"project_code" bson:"projectCode"`
	ClusterID          string             `json:"cluster_id" bson:"clusterID"`
	Rule               bklog.LogRule      `json:"rule" bson:"rule"`
	FileIndexSetID     int                `json:"file_index_set_id" bson:"fileIndexSetID"`
	STDIndexSetID      int                `json:"std_index_set_id" bson:"stdIndexSetID"`
	RuleFileIndexSetID int                `json:"rule_file_index_set_id" bson:"ruleFileIndexSetID"`
	RuleSTDIndexSetID  int                `json:"rule_std_index_set_id" bson:"ruleSTDIndexSetID"`
	CreatedAt          utils.JSONTime     `json:"created_at" bson:"createdAt"`
	UpdatedAt          utils.JSONTime     `json:"updated_at" bson:"updatedAt"`
	Creator            string             `json:"creator" bson:"creator"`
	Updator            string             `json:"updator" bson:"updator"`
	Status             string             `json:"status" bson:"status"`
	Message            string             `json:"message" bson:"message"`
	FromRule           string             `json:"from_rule" bson:"fromRule"`
}

LogRule log rule

func (*LogRule) FixStatus

func (r *LogRule) FixStatus()

FixStatus fix log rule status when status is stucked

type M

type M map[string]interface{}

M used for incremental update

func (M) GetString

func (m M) GetString(key string) string

GetString return string value of interface

func (M) Update

func (m M) Update(k string, v interface{}) M

Update k-v

func (M) Updates

func (m M) Updates(um M) M

Updates k-v pairs

Jump to

Keyboard shortcuts

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