-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.go
More file actions
43 lines (36 loc) · 1.2 KB
/
Copy pathmessage.go
File metadata and controls
43 lines (36 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package model
import (
"context"
ui "github.com/compforge/agentue/sdks/go/ui"
"github.com/compforge/loopd/pkg/contract"
)
type MessageInfo = contract.MessageInfo
type MessageSnapshot = contract.Message
type BlockSnapshot = contract.BlockSnapshot
type MessageQuery = contract.MessageQuery
type MessageOrder = contract.MessageOrder
const (
Asc = contract.MessageAsc
Desc = contract.MessageDesc
)
// Message is a lazy read capability, not ownership of the writer or its execution.
// ID access never performs I/O; every data read returns the current server snapshot.
// +spec=`Message exposes logical content only; physical Parts never enter Operator reads or handles.`
type Message interface {
ID() string
ConversationID() string
Info(context.Context) (MessageInfo, error)
Snapshot(context.Context) (MessageSnapshot, error)
Block(context.Context, string) (BlockSnapshot, error)
Blocks(context.Context, func(BlockSnapshot) error) error
}
type Stream interface {
Message
Emit(context.Context, ui.Event) error
End(context.Context, ...contract.MessageStatus) error
}
type MessagePage struct {
Messages []Message
Infos []MessageInfo // metadata observed by List; no implicit cached reads
Next string
}