Documentation
¶
Index ¶
Constants ¶
View Source
const ( CategoryShell = "shell" CategorySQL = "sql" CategoryRedis = "redis" CategoryMongo = "mongo" CategoryK8s = "k8s" CategoryPrompt = "prompt" )
片段分类常量
View Source
const ( // SourceUser 用户自创建片段 SourceUser = "user" // SourceExtPrefix 扩展来源前缀,完整 source 形如 "ext:<extension-name>" SourceExtPrefix = "ext:" )
片段来源常量
View Source
const ( StatusActive int8 = 1 StatusDeleted int8 = 2 )
状态常量(遵循仓库软删除约定)
Variables ¶
This section is empty.
Functions ¶
func CategoryAssetType ¶
CategoryAssetType 返回分类绑定的资产类型(asset_entity.AssetType*) prompt 不绑定资产;未知分类返回空字符串。
Types ¶
type Snippet ¶
type Snippet struct {
ID int64 `gorm:"primaryKey"`
Name string `gorm:"size:128;not null;index"`
Category string `gorm:"size:32;not null;index"`
Content string `gorm:"type:text;not null"`
Description string `gorm:"size:512;not null;default:''"`
LastAssetIDs string `gorm:"size:1024;not null;default:''"` // comma-separated int64; UI-authoritative
Source string `gorm:"size:64;not null;default:user;index"`
SourceRef string `gorm:"size:128;not null;default:''"`
UseCount uint `gorm:"not null;default:0"`
LastUsedAt *time.Time `gorm:"column:last_used_at"`
Status int8 `gorm:"not null;default:1;index"`
CreatedAt time.Time
UpdatedAt time.Time
}
Snippet 片段实体
Click to show internal directories.
Click to hide internal directories.