Documentation
¶
Index ¶
- Constants
- func Delete(ctx context.Context, id string) error
- func DeleteSessionFiles(ctx context.Context, sessionID string) error
- func InitService(sqlDatabase *sql.DB) error
- func Subscribe(ctx context.Context) <-chan pubsub.Event[File]
- type File
- func Create(ctx context.Context, sessionID, path, content string) (File, error)
- func CreateVersion(ctx context.Context, sessionID, path, content string) (File, error)
- func Get(ctx context.Context, id string) (File, error)
- func GetByPathAndVersion(ctx context.Context, sessionID, path, version string) (File, error)
- func GetLatestByPathAndSession(ctx context.Context, path, sessionID string) (File, error)
- func ListBySession(ctx context.Context, sessionID string) ([]File, error)
- func ListLatestSessionFiles(ctx context.Context, sessionID string) ([]File, error)
- func ListVersionsByPath(ctx context.Context, path string) ([]File, error)
- func Update(ctx context.Context, file File) (File, error)
- type Service
Constants ¶
View Source
const ( EventFileCreated pubsub.EventType = "history_file_created" EventFileVersionCreated pubsub.EventType = "history_file_version_created" EventFileUpdated pubsub.EventType = "history_file_updated" EventFileDeleted pubsub.EventType = "history_file_deleted" EventSessionFilesDeleted pubsub.EventType = "history_session_files_deleted" )
View Source
const (
InitialVersion = "initial"
)
Variables ¶
This section is empty.
Functions ¶
func InitService ¶
Types ¶
type File ¶
type File struct { ID string SessionID string Path string Content string Version string CreatedAt time.Time UpdatedAt time.Time }
func CreateVersion ¶
func GetByPathAndVersion ¶
func ListLatestSessionFiles ¶
type Service ¶
type Service interface { pubsub.Subscriber[File] Create(ctx context.Context, sessionID, path, content string) (File, error) CreateVersion(ctx context.Context, sessionID, path, content string) (File, error) Get(ctx context.Context, id string) (File, error) GetByPathAndVersion(ctx context.Context, sessionID, path, version string) (File, error) GetLatestByPathAndSession(ctx context.Context, path, sessionID string) (File, error) ListBySession(ctx context.Context, sessionID string) ([]File, error) ListLatestSessionFiles(ctx context.Context, sessionID string) ([]File, error) ListVersionsByPath(ctx context.Context, path string) ([]File, error) Update(ctx context.Context, file File) (File, error) Delete(ctx context.Context, id string) error DeleteSessionFiles(ctx context.Context, sessionID string) error }
func GetService ¶
func GetService() Service
Click to show internal directories.
Click to hide internal directories.