Documentation ¶
Index ¶
- Constants
- Variables
- type AggregateSuggester
- type AuthorsSuggester
- type Blacklist
- type Blacklister
- type BroaderConcept
- type BroaderConceptsProvider
- type Client
- type Concept
- type ConceptBlacklister
- type ConcordanceResponse
- type ConcordanceService
- type OntotextSuggester
- type Suggester
- type SuggesterErr
- type Suggestion
- type SuggestionApi
- func (suggester *SuggestionApi) Check() health.Check
- func (suggester *SuggestionApi) FilterSuggestions(suggestions []Suggestion) []Suggestion
- func (suggester *SuggestionApi) GetName() string
- func (suggester *SuggestionApi) GetSuggestions(payload []byte, tid, origin string) (SuggestionsResponse, error)
- type SuggestionsResponse
- type Thing
Constants ¶
View Source
const PanicGuideURL = "https://runbooks.in.ft.com/"
Variables ¶
View Source
var ( NoContentError = &SuggesterErr{msg: "Suggestion API returned HTTP 204"} BadRequestError = &SuggesterErr{msg: "Suggestion API returned HTTP 400"} PseudoConceptTypeAuthor = "author" PersonSourceParam = "personSource" LocationSourceParam = "locationSource" OrganisationSourceParam = "organisationSource" TopicSourceParam = "topicSource" )
Functions ¶
This section is empty.
Types ¶
type AggregateSuggester ¶
type AggregateSuggester struct { Concordance *ConcordanceService BroaderProvider *BroaderConceptsProvider Blacklister ConceptBlacklister Suggesters []Suggester Log *logger.UPPLogger }
func NewAggregateSuggester ¶
func NewAggregateSuggester(log *logger.UPPLogger, concordance *ConcordanceService, broaderConceptsProvider *BroaderConceptsProvider, blacklister ConceptBlacklister, suggesters ...Suggester) *AggregateSuggester
func (*AggregateSuggester) GetSuggestions ¶
func (s *AggregateSuggester) GetSuggestions(payload []byte, tid, origin string) (SuggestionsResponse, error)
GetSuggestions calls several services to build it's return value.
It calls concurrently the Suggesters and the Blacklister and waits them. It then calls the BroaderProvider to exclude the broader concepts.
payload is the content send to the Suggesters. tid is propaged down the request chain. origin is propaged down only to the Suggesters.
type AuthorsSuggester ¶
type AuthorsSuggester struct {
SuggestionApi
}
func NewAuthorsSuggester ¶
func NewAuthorsSuggester(authorsSuggestionApiBaseURL, authorsSuggestionEndpoint string, client Client) *AuthorsSuggester
type Blacklister ¶
type Blacklister struct {
// contains filtered or unexported fields
}
func (*Blacklister) Check ¶
func (b *Blacklister) Check() v1_1.Check
func (*Blacklister) GetBlacklist ¶
func (b *Blacklister) GetBlacklist(tid string) (Blacklist, error)
func (*Blacklister) IsBlacklisted ¶
func (b *Blacklister) IsBlacklisted(conceptId string, bl Blacklist) bool
type BroaderConcept ¶
type BroaderConcept struct {
ID string `json:"id"`
}
type BroaderConceptsProvider ¶
type BroaderConceptsProvider struct { PublicThingsBaseURL string PublicThingsEndpoint string Client Client // contains filtered or unexported fields }
func NewBroaderConceptsProvider ¶
func NewBroaderConceptsProvider(publicThingsAPIBaseURL, publicThingsEndpoint string, client Client) *BroaderConceptsProvider
func (*BroaderConceptsProvider) Check ¶
func (b *BroaderConceptsProvider) Check() v1_1.Check
type ConceptBlacklister ¶
type ConceptBlacklister interface { IsBlacklisted(uuid string, bl Blacklist) bool GetBlacklist(tid string) (Blacklist, error) Check() v1_1.Check }
func NewConceptBlacklister ¶
func NewConceptBlacklister(baseUrl string, endpoint string, client Client) ConceptBlacklister
type ConcordanceResponse ¶
type ConcordanceService ¶
type ConcordanceService struct { ConcordanceBaseURL string ConcordanceEndpoint string Client Client // contains filtered or unexported fields }
func NewConcordance ¶
func NewConcordance(internalConcordancesApiBaseURL, internalConcordancesEndpoint string, client Client) *ConcordanceService
func (*ConcordanceService) Check ¶
func (concordance *ConcordanceService) Check() v1_1.Check
type OntotextSuggester ¶
type OntotextSuggester struct {
SuggestionApi
}
func NewOntotextSuggester ¶
func NewOntotextSuggester(ontotextSuggestionApiBaseURL, ontotextSuggestionEndpoint string, client Client) *OntotextSuggester
type Suggester ¶
type Suggester interface { GetSuggestions(payload []byte, tid, origin string) (SuggestionsResponse, error) FilterSuggestions(suggestions []Suggestion) []Suggestion GetName() string }
type SuggesterErr ¶ added in v1.6.3
type SuggesterErr struct {
// contains filtered or unexported fields
}
SuggesterErr is error type returned suggester GetSuggestions method
func (*SuggesterErr) Error ¶ added in v1.6.3
func (s *SuggesterErr) Error() string
func (*SuggesterErr) Unwrap ¶ added in v1.6.3
func (s *SuggesterErr) Unwrap() error
type Suggestion ¶
type SuggestionApi ¶
type SuggestionApi struct {
// contains filtered or unexported fields
}
func (*SuggestionApi) Check ¶
func (suggester *SuggestionApi) Check() health.Check
func (*SuggestionApi) FilterSuggestions ¶
func (suggester *SuggestionApi) FilterSuggestions(suggestions []Suggestion) []Suggestion
func (*SuggestionApi) GetName ¶
func (suggester *SuggestionApi) GetName() string
func (*SuggestionApi) GetSuggestions ¶
func (suggester *SuggestionApi) GetSuggestions(payload []byte, tid, origin string) (SuggestionsResponse, error)
type SuggestionsResponse ¶
type SuggestionsResponse struct {
Suggestions []Suggestion `json:"suggestions"`
}
type Thing ¶
type Thing struct { ID string `json:"id"` BroaderConcepts []BroaderConcept `json:"broaderConcepts"` }
Click to show internal directories.
Click to hide internal directories.