knowledge

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCommitID

func GenerateCommitID(updatedAt time.Time, author types.UserID, content string) string

GenerateCommitID generates SHA256 hash from updatedAt + author + content

Types

type Knowledge

type Knowledge struct {
	// Slug uniquely identifies the knowledge within a topic
	Slug types.KnowledgeSlug `json:"slug"`

	// Name is a human-readable short name (max 100 chars)
	Name string `json:"name"`

	// Topic is the namespace for this knowledge
	Topic types.KnowledgeTopic `json:"topic"`

	// Content is the actual knowledge text
	Content string `json:"content"`

	// CommitID is the SHA256 hash version identifier
	CommitID string `json:"commit_id"`

	// Author is who created/updated this knowledge
	Author types.UserID `json:"author"`

	// CreatedAt is the timestamp when this slug was first created
	CreatedAt time.Time `json:"created_at"`

	// UpdatedAt is the timestamp when this version was created
	UpdatedAt time.Time `json:"updated_at"`

	// State indicates if this knowledge is active or archived
	State types.KnowledgeState `json:"state"`
}

Knowledge represents a user-instructed memory with versioning

func (*Knowledge) Size

func (k *Knowledge) Size() int

Size returns the content size in bytes (for quota calculation)

func (*Knowledge) Validate

func (k *Knowledge) Validate() error

Validate checks if the Knowledge is valid

type SlugInfo

type SlugInfo struct {
	Slug types.KnowledgeSlug `json:"slug"`
	Name string              `json:"name"`
}

SlugInfo contains slug and name pair for listing

type TopicSummary

type TopicSummary struct {
	Topic types.KnowledgeTopic `json:"topic"`
	Count int                  `json:"count"`
}

TopicSummary contains topic and knowledge count

Jump to

Keyboard shortcuts

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