Help us shape the future of Go! Take the 2026 Go Developer Survey

repository

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package repository 提供 agent 域各持久化端口的基于数据库(GORM)的实现。

架构说明:

  • 持久化端口(TaskRepository / PermissionRepository / QuestionRepository / EventRepository / ConversationRepository / MemoryRepository / ProfileRepository 接口) 定义在 agent 包中,由消费方(AgentService 等编排层)持有,遵循「接口定义在消费侧」。
  • 本包作为适配器层,把这些端口的实现落到数据库。因为实现需要引用 agent 包的领域类型 (Task / AgentEvent / PermissionRequest ...),所以本包单向依赖 agent 包;agent 包 不反向依赖本包,从而避免循环依赖。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGormConversationRepository

func NewGormConversationRepository(db *gorm.DB) agent.ConversationRepository

NewGormConversationRepository 创建基于数据库的会话 Repository。

会话与其消息(agent_conversation_messages 表)的关系由本实现自行维护, 不使用 GORM 的 HasMany 关联。

func NewGormEventRepository

func NewGormEventRepository(db *gorm.DB) agent.EventRepository

NewGormEventRepository 创建基于数据库的事件流 Repository。

func NewGormMemoryRepository

func NewGormMemoryRepository(db *gorm.DB) agent.MemoryRepository

NewGormMemoryRepository 创建基于数据库的记忆 Repository。

func NewGormPermissionRepository

func NewGormPermissionRepository(db *gorm.DB) agent.PermissionRepository

NewGormPermissionRepository 创建基于数据库的权限请求 Repository。

func NewGormProfileRepository

func NewGormProfileRepository(db *gorm.DB) agent.ProfileRepository

NewGormProfileRepository 创建基于数据库的用户自定义 Profile Repository。

func NewGormQuestionRepository

func NewGormQuestionRepository(db *gorm.DB) agent.QuestionRepository

NewGormQuestionRepository 创建基于数据库的提问请求 Repository。

func NewGormTaskRepository

func NewGormTaskRepository(db *gorm.DB) agent.TaskRepository

NewGormTaskRepository 创建基于数据库的任务 Repository。

Types

This section is empty.

Jump to

Keyboard shortcuts

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