Documentation
¶
Index ¶
Constants ¶
View Source
const (
// InitialVersion is the version string for the first version of a file.
InitialVersion = "initial"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
ID string
SessionID string
Path string
Content string
Version string
CreatedAt int64
UpdatedAt int64
}
File represents a versioned file in the session history.
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)
GetByPathAndSession(ctx context.Context, path, sessionID string) (File, error)
ListBySession(ctx context.Context, sessionID string) ([]File, error)
ListLatestSessionFiles(ctx context.Context, sessionID string) ([]File, error)
ListBySessionTree(ctx context.Context, rootSessionID string) ([]File, error)
ListLatestSessionTreeFiles(ctx context.Context, rootSessionID 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
}
Service provides operations for managing file history.
func NewService ¶
func NewService(q db.QuerierWithTx, database *sql.DB) Service
NewService creates a new file history service.
Click to show internal directories.
Click to hide internal directories.