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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKnowledgeTopic     = "default"
	DefaultKnowledgeSizeLimit = 10 * 1024 // 10KB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(repo interfaces.Repository) *Service

func (*Service) ArchiveKnowledge

func (s *Service) ArchiveKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug) error

ArchiveKnowledge archives a knowledge

func (*Service) GetKnowledge

func (s *Service) GetKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug) (*knowledge.Knowledge, error)

GetKnowledge retrieves a specific knowledge by slug

func (*Service) GetKnowledges

func (s *Service) GetKnowledges(ctx context.Context, topic types.KnowledgeTopic) ([]*knowledge.Knowledge, error)

GetKnowledges retrieves all active knowledges for a topic

func (*Service) ListSlugs

func (s *Service) ListSlugs(ctx context.Context, topic types.KnowledgeTopic) ([]*knowledge.SlugInfo, error)

ListSlugs returns all slugs and names for a topic

func (*Service) SaveKnowledge

func (s *Service) SaveKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug, name, content string, author types.UserID) (string, error)

SaveKnowledge saves a new version of a knowledge with quota check

Jump to

Keyboard shortcuts

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