database

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB) error

AutoMigrate 自动迁移数据库表结构

func Close

func Close() error

Close 关闭数据库连接

func GetDB

func GetDB() *gorm.DB

GetDB 获取数据库连接实例(单例模式)

Types

type OldLLMConfig

type OldLLMConfig struct {
	ID        uint            `gorm:"primaryKey"`
	Providers json.RawMessage `gorm:"type:text"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

OldLLMConfig 旧的LLM配置结构(用于迁移)

func (OldLLMConfig) TableName

func (OldLLMConfig) TableName() string

type OldLLMProviderInstance

type OldLLMProviderInstance struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Enabled  bool   `json:"enabled"`
	Provider string `json:"provider"`
	Model    string `json:"model"`
	APIKey   string `json:"api_key"`
	BaseURL  string `json:"base_url"`
}

OldLLMProviderInstance 旧的LLM提供商实例结构

Jump to

Keyboard shortcuts

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