Documentation
¶
Index ¶
- type Checkpoint
- type JSONSerializer
- type MemoryStore
- func (s *MemoryStore) Latest(ctx context.Context, runID string) (Checkpoint, bool, error)
- func (s *MemoryStore) List(_ context.Context, runID string) ([]Checkpoint, error)
- func (s *MemoryStore) Load(_ context.Context, id string) (Checkpoint, error)
- func (s *MemoryStore) Save(_ context.Context, checkpoint Checkpoint) (Checkpoint, error)
- type Serializer
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
ID string `json:"id"`
ProjectID string `json:"project_id,omitempty"`
WorkflowID string `json:"workflow_id"`
SessionID string `json:"session_id,omitempty"`
RunID string `json:"run_id"`
NodeID string `json:"node_id"`
ParentID string `json:"parent_id,omitempty"`
Sequence int64 `json:"sequence"`
State json.RawMessage `json:"state"`
CreatedAt time.Time `json:"created_at"`
}
type JSONSerializer ¶
type JSONSerializer[S any] struct{}
func NewJSONSerializer ¶
func NewJSONSerializer[S any]() JSONSerializer[S]
func (JSONSerializer[S]) Marshal ¶
func (JSONSerializer[S]) Marshal(state S) (json.RawMessage, error)
func (JSONSerializer[S]) Unmarshal ¶
func (JSONSerializer[S]) Unmarshal(snapshot json.RawMessage) (S, error)
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Latest ¶
func (s *MemoryStore) Latest(ctx context.Context, runID string) (Checkpoint, bool, error)
func (*MemoryStore) List ¶
func (s *MemoryStore) List(_ context.Context, runID string) ([]Checkpoint, error)
func (*MemoryStore) Load ¶
func (s *MemoryStore) Load(_ context.Context, id string) (Checkpoint, error)
func (*MemoryStore) Save ¶
func (s *MemoryStore) Save(_ context.Context, checkpoint Checkpoint) (Checkpoint, error)
type Serializer ¶
type Serializer[S any] interface { Marshal(S) (json.RawMessage, error) Unmarshal(json.RawMessage) (S, error) }
type Store ¶
type Store interface {
Save(context.Context, Checkpoint) (Checkpoint, error)
Load(context.Context, string) (Checkpoint, error)
List(context.Context, string) ([]Checkpoint, error)
Latest(context.Context, string) (Checkpoint, bool, error)
}
Click to show internal directories.
Click to hide internal directories.