Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IKeyStore ¶
type IKeyStore interface { store.ISearchStore[Key] }
type ILogMetricsStore ¶
type ILogMetricsStore interface { store.ISearchStore[LogMetrics] }
type IProviderStore ¶
type IProviderStore interface { store.ISearchStore[Provider] }
type Key ¶
type Key struct { Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"` Uuid string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"` Name string `gorm:"type:varchar(100);not null;column:name;comment:名称"` Config string `gorm:"type:text;not null;column:config;comment:配置"` Provider string `gorm:"type:varchar(36);not null;column:provider;comment:供应商ID"` Status int `gorm:"type:tinyint(1);not null;column:status;comment:状态,0:停用;1:启用,2:错误;3:超额;4:过期"` ExpireTime int `gorm:"type:int;not null;column:expire_time;comment:过期时间"` UseToken int `gorm:"type:int;not null;column:use_token;comment:使用token数"` Sort int `gorm:"type:int;not null;column:sort;comment:排序"` Creator string `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人 Updater string `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人 CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"` UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"` Default bool `gorm:"type:tinyint(1);not null;column:default;comment:是否默认"` }
type LogMetrics ¶
type LogMetrics struct { Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"` UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"` Provider string `gorm:"type:varchar(36);not null;column:provider;comment:供应商ID"` Model string `gorm:"type:varchar(36);not null;column:model;comment:模型ID"` InputToken int `gorm:"type:int;not null;column:input_token;comment:输入token"` OutputToken int `gorm:"type:int;not null;column:output_token;comment:输出token"` TotalToken int `gorm:"type:int;not null;column:total_token;comment:总token"` Cost float64 `gorm:"type:int;not null;column:cost;comment:费用"` Per float64 `gorm:"type:int;not null;column:per;comment:每个token的价格"` }
func (*LogMetrics) IdValue ¶
func (i *LogMetrics) IdValue() int64
func (*LogMetrics) TableName ¶
func (i *LogMetrics) TableName() string
type Provider ¶
type Provider struct { Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"` UUID string `gorm:"type:varchar(36);not null;column:uuid;uniqueIndex:uuid;comment:UUID;"` Name string `gorm:"type:varchar(100);not null;column:name;comment:name"` DefaultLLM string `gorm:"type:varchar(255);not null;column:default_llm;comment:默认模型ID"` Config string `gorm:"type:text;not null;column:config;comment:配置信息"` Status int `gorm:"type:tinyint(1);not null;column:status;comment:状态,0:停用;1:启用,2:异常"` Priority int `gorm:"type:int;not null;column:priority;comment:优先级,值越小优先级越高"` Creator string `gorm:"size:36;not null;column:creator;comment:创建人;index:creator" aovalue:"creator"` // 创建人 Updater string `gorm:"size:36;not null;column:updater;comment:更新人;index:updater" aovalue:"updater"` // 更新人 CreateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:create_at;comment:创建时间"` UpdateAt time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:update_at;comment:更新时间"` }
Click to show internal directories.
Click to hide internal directories.