checkpoint

package
v1.0.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL