MCPcopy Create free account
hub / github.com/astercloud/aster / AddEntry

Method AddEntry

pkg/memory/project/types.go:154–167  ·  view source on GitHub ↗

AddEntry 添加条目到指定章节

(section MemorySection, entry *Entry)

Source from the content-addressed store, hash-verified

152
153// AddEntry 添加条目到指定章节
154func (pm *ProjectMemory) AddEntry(section MemorySection, entry *Entry) {
155 if pm.Sections[section] == nil {
156 pm.Sections[section] = &Section{
157 Name: string(section),
158 Entries: []*Entry{},
159 }
160 }
161 if entry.CreatedAt.IsZero() {
162 entry.CreatedAt = time.Now()
163 }
164 pm.Sections[section].Entries = append(pm.Sections[section].Entries, entry)
165 pm.UpdatedAt = time.Now()
166 pm.Version++
167}
168
169// GetEntries 获取指定章节的所有条目
170func (pm *ProjectMemory) GetEntries(section MemorySection) []*Entry {

Callers 4

parseMarkdownMethod · 0.95
AppendEntryMethod · 0.80
UpdateWorkflowStepMethod · 0.80
RecordParamsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected