Documentation
¶
Index ¶
- Constants
- type Service
- func (s *Service) ArchiveKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug) error
- func (s *Service) GetKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug) (*knowledge.Knowledge, error)
- func (s *Service) GetKnowledges(ctx context.Context, topic types.KnowledgeTopic) ([]*knowledge.Knowledge, error)
- func (s *Service) ListSlugs(ctx context.Context, topic types.KnowledgeTopic) ([]*knowledge.SlugInfo, error)
- func (s *Service) SaveKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug, ...) (string, error)
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
Click to show internal directories.
Click to hide internal directories.