mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
wip: refactoring
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
||||
)
|
||||
|
||||
// Session represents a conversation session.
|
||||
type Session struct {
|
||||
ID string
|
||||
ParentSessionID string
|
||||
@@ -27,16 +26,12 @@ type Session struct {
|
||||
UpdatedAt int64
|
||||
}
|
||||
|
||||
// --- Events ---
|
||||
|
||||
const (
|
||||
EventSessionCreated pubsub.EventType = "session_created"
|
||||
EventSessionUpdated pubsub.EventType = "session_updated"
|
||||
EventSessionDeleted pubsub.EventType = "session_deleted"
|
||||
)
|
||||
|
||||
// --- Service Definition ---
|
||||
|
||||
type Service interface {
|
||||
pubsub.Subscriber[Session]
|
||||
|
||||
@@ -77,8 +72,6 @@ func GetService() Service {
|
||||
return globalSessionService
|
||||
}
|
||||
|
||||
// --- Service Methods ---
|
||||
|
||||
func (s *service) Create(ctx context.Context, title string) (Session, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user