storage

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchInsertTaskCaches

func BatchInsertTaskCaches(db *gorm.DB, sessionID string, tasks []*dag.Task) error

func CreateSession

func CreateSession(db *gorm.DB, s *SessionModel) error

func DeleteSession

func DeleteSession(db *gorm.DB, id string) error

func DeleteTaskCache

func DeleteTaskCache(db *gorm.DB, sessionID, taskID string) error

func DeleteTaskCachesBySession

func DeleteTaskCachesBySession(db *gorm.DB, sessionID string) error

func NewDB

func NewDB(path string) (*gorm.DB, error)

func NewDBInMemory

func NewDBInMemory() (*gorm.DB, error)

func ReadRoadmap

func ReadRoadmap(path string) ([]*dag.Task, error)

func UpdateSessionAccess

func UpdateSessionAccess(db *gorm.DB, id string, t time.Time) error

func UpsertTaskCache

func UpsertTaskCache(db *gorm.DB, sessionID string, task *dag.Task) error

func WriteRoadmap

func WriteRoadmap(path string, tasks []*dag.Task) error

Types

type SessionModel

type SessionModel struct {
	ID          string `gorm:"primaryKey"`
	Path        string `gorm:"not null;uniqueIndex"`
	Description string
	State       string `gorm:"default:Loaded"`
	ChunksCount int    `gorm:"default:0"`
	LastAccess  int64
	CreatedAt   int64
}

func GetSession

func GetSession(db *gorm.DB, id string) (*SessionModel, error)

func ListSessions

func ListSessions(db *gorm.DB) ([]SessionModel, error)

type TaskCache

type TaskCache struct {
	SessionID     string `gorm:"primaryKey;not null"`
	ID            string `gorm:"primaryKey;not null"`
	Name          string
	Description   string
	Status        string
	Embedding     []byte // float32[] little-endian
	Dependencies  string // JSON array
	DocReferences string // JSON array
	Archived      bool
	UpdatedAt     int64
}

func GetTaskCachesBySession

func GetTaskCachesBySession(db *gorm.DB, sessionID string) ([]TaskCache, error)

Jump to

Keyboard shortcuts

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