kb

package
v3.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrArticleNotFound = errors.New("KB article not found")

Functions

func GetArticleIndex

func GetArticleIndex(url string) (uint64, error)

GetArticleIndex retrieves the index of an article from its url. if the article is not found, ErrArticleNotFound is returned.

Types

type Article

type Article struct {
	Index    uint64   `json:"index"`
	URL      string   `json:"url"`
	Title    string   `json:"title"`
	Keywords []string `json:"keywords"`
	Score    int
}

Article is a struct that holds information about a knowledge-base article.

type ArticleList

type ArticleList []*Article

func GetArticleList

func GetArticleList() (ArticleList, error)

GetArticleList returns the list of KB articles.

func GetSuggestions

func GetSuggestions(userInput string) (ArticleList, error)

GetSuggestions returns a list of up to 3 suggestions for the built-in list of KB articles matching the given user input.

func GetSuggestionsFromArticleList

func GetSuggestionsFromArticleList(userInput string, articles ArticleList) (ArticleList, error)

GetSuggestionsFromArticleList returns a list of up to 3 suggestions for the given list of KB articles matching the given user input.

Jump to

Keyboard shortcuts

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