Documentation
¶
Index ¶
- type ConflictResolution
- type MemoryEntry
- type MemoryType
- type TypedMemoryStore
- func (s *TypedMemoryStore) Create(entry *MemoryEntry) error
- func (s *TypedMemoryStore) Delete(id string) bool
- func (s *TypedMemoryStore) GetAverageConfidence(memType MemoryType) float64
- func (s *TypedMemoryStore) GetPruningCandidates(now time.Time) []*MemoryEntry
- func (s *TypedMemoryStore) GetStats() map[MemoryType]int
- func (s *TypedMemoryStore) ListAll() []*MemoryEntry
- func (s *TypedMemoryStore) ListByType(memType MemoryType) []*MemoryEntry
- func (s *TypedMemoryStore) Prune(now time.Time) int
- func (s *TypedMemoryStore) Read(id string) (*MemoryEntry, bool)
- func (s *TypedMemoryStore) Update(id string, updateFn func(*MemoryEntry)) bool
- func (s *TypedMemoryStore) UpsertWithConflictResolution(entry *MemoryEntry) ConflictResolution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConflictResolution ¶
type ConflictResolution struct {
Winner *MemoryEntry
Loser *MemoryEntry
Reason string
Resolved bool
}
func ResolveConflict ¶
func ResolveConflict(existing, incoming *MemoryEntry) ConflictResolution
type MemoryEntry ¶
type MemoryType ¶
type MemoryType string
const ( MemoryTypeIdentity MemoryType = "identity" MemoryTypePreference MemoryType = "preference" MemoryTypeGoal MemoryType = "goal" MemoryTypeHabit MemoryType = "habit" MemoryTypeEpisode MemoryType = "episode" MemoryTypeReflection MemoryType = "reflection" )
type TypedMemoryStore ¶
type TypedMemoryStore struct {
// contains filtered or unexported fields
}
func NewTypedMemoryStore ¶
func NewTypedMemoryStore() *TypedMemoryStore
func (*TypedMemoryStore) Create ¶
func (s *TypedMemoryStore) Create(entry *MemoryEntry) error
func (*TypedMemoryStore) Delete ¶
func (s *TypedMemoryStore) Delete(id string) bool
func (*TypedMemoryStore) GetAverageConfidence ¶
func (s *TypedMemoryStore) GetAverageConfidence(memType MemoryType) float64
func (*TypedMemoryStore) GetPruningCandidates ¶
func (s *TypedMemoryStore) GetPruningCandidates(now time.Time) []*MemoryEntry
func (*TypedMemoryStore) GetStats ¶
func (s *TypedMemoryStore) GetStats() map[MemoryType]int
func (*TypedMemoryStore) ListAll ¶
func (s *TypedMemoryStore) ListAll() []*MemoryEntry
func (*TypedMemoryStore) ListByType ¶
func (s *TypedMemoryStore) ListByType(memType MemoryType) []*MemoryEntry
func (*TypedMemoryStore) Read ¶
func (s *TypedMemoryStore) Read(id string) (*MemoryEntry, bool)
func (*TypedMemoryStore) Update ¶
func (s *TypedMemoryStore) Update(id string, updateFn func(*MemoryEntry)) bool
func (*TypedMemoryStore) UpsertWithConflictResolution ¶
func (s *TypedMemoryStore) UpsertWithConflictResolution(entry *MemoryEntry) ConflictResolution
Click to show internal directories.
Click to hide internal directories.