Documentation ¶
Index ¶
- Variables
- func Router(th *Handler) *mux.Router
- type BasicConcept
- type ConceptUUID
- type Handler
- func (th *Handler) EnforceDataLoaded(next http.Handler) http.Handler
- func (th *Handler) EnforceTaxonomy(next http.Handler) http.Handler
- func (th *Handler) G2GCheck() gtg.Status
- func (th *Handler) GetCount(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) GetIDs(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) HandleGetFullTaxonomy(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) HandleGetSingleConcept(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) HandleReloadConcepts(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) HandleSendConcepts(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) HandleSendSingle(resp http.ResponseWriter, req *http.Request)
- func (th *Handler) HealthCheck() []fthealth.Check
- type Service
- type ServiceImpl
- func (s *ServiceImpl) GetAllConcepts(endpoint string) (io.PipeReader, error)
- func (s *ServiceImpl) GetConceptByUUID(endpoint, uuid string) (*BasicConcept, bool, error)
- func (s *ServiceImpl) GetConceptUUIDs(endpoint string) (io.PipeReader, error)
- func (s *ServiceImpl) GetCount(endpoint string) (int, error)
- func (s *ServiceImpl) GetLoadedTypes() []string
- func (s *ServiceImpl) IsDataLoaded(endpoint string) bool
- func (s *ServiceImpl) RefreshConceptByUUID(endpoint, uuid string) (*BasicConcept, bool, error)
- func (s *ServiceImpl) Reload(endpoint string) error
- func (s *ServiceImpl) SendConceptByUUID(txID, endpoint, uuid string, ignoreHash bool) error
- func (s *ServiceImpl) SendConcepts(endpoint, jobID string, ignoreHash bool) error
- type Taxonomy
- type Term
- type Transformer
Constants ¶
This section is empty.
Variables ¶
View Source
var EndpointTypeMappings = map[string]map[string]interface{}{ "alphaville-series": { "taxonomy": "AlphavilleSeriesClassification", "source": &tmereader.KnowledgeBases{}, "type": "AlphavilleSeries", }, "authors": { "taxonomy": "Authors", "source": &tmereader.AuthorityFiles{}, "type": "Person", }, "brands": { "taxonomy": "Brands", "source": &tmereader.AuthorityFiles{}, "type": "Brand", }, "genres": { "taxonomy": "Genres", "source": &tmereader.KnowledgeBases{}, "type": "Genre", }, "locations": { "taxonomy": "GL", "source": &tmereader.AuthorityFiles{}, "type": "Location", }, "people": { "taxonomy": "PN", "source": &tmereader.AuthorityFiles{}, "type": "Person", }, "sections": { "taxonomy": "Sections", "source": &tmereader.KnowledgeBases{}, "type": "Section", }, "special-reports": { "taxonomy": "SpecialReports", "source": &tmereader.AuthorityFiles{}, "type": "SpecialReport", }, "subjects": { "taxonomy": "Subjects", "source": &tmereader.KnowledgeBases{}, "type": "Subject", }, "topics": { "taxonomy": "Topics", "source": &tmereader.KnowledgeBases{}, "type": "Topic", }, "organisations": { "taxonomy": "ON", "source": &tmereader.AuthorityFiles{}, "type": "Organisation", }, }
Functions ¶
Types ¶
type BasicConcept ¶
type BasicConcept struct { UUID string `json:"uuid"` ParentUUIDs []string `json:"parentUUIDs,omitempty"` PrefLabel string `json:"prefLabel,omitempty"` Type string `json:"type,omitempty"` Authority string `json:"authority,omitempty"` AuthorityValue string `json:"authorityValue,omitempty"` Aliases []string `json:"aliases,omitempty"` IsDeprecated bool `json:"isDeprecated,omitempty"` }
type ConceptUUID ¶
type ConceptUUID struct {
UUID string `json:"uuid"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) EnforceDataLoaded ¶
func (*Handler) EnforceTaxonomy ¶
func (*Handler) HandleGetFullTaxonomy ¶
func (th *Handler) HandleGetFullTaxonomy(resp http.ResponseWriter, req *http.Request)
func (*Handler) HandleGetSingleConcept ¶
func (th *Handler) HandleGetSingleConcept(resp http.ResponseWriter, req *http.Request)
func (*Handler) HandleReloadConcepts ¶
func (th *Handler) HandleReloadConcepts(resp http.ResponseWriter, req *http.Request)
func (*Handler) HandleSendConcepts ¶
func (th *Handler) HandleSendConcepts(resp http.ResponseWriter, req *http.Request)
func (*Handler) HandleSendSingle ¶
func (th *Handler) HandleSendSingle(resp http.ResponseWriter, req *http.Request)
func (*Handler) HealthCheck ¶
type Service ¶
type Service interface { IsDataLoaded(endpoint string) bool GetCount(endpoint string) (int, error) GetAllConcepts(endpoint string) (io.PipeReader, error) GetConceptByUUID(endpoint, uuid string) (*BasicConcept, bool, error) GetConceptUUIDs(endpoint string) (io.PipeReader, error) SendConcepts(endpoint, jobID string, ignoreHash bool) error RefreshConceptByUUID(endpoint, uuid string) (*BasicConcept, bool, error) SendConceptByUUID(txID, endpoint, uuid string, ignoreHash bool) error Reload(endpoint string) error GetLoadedTypes() []string }
Service - the main service interface
func NewService ¶
func NewService(repos map[string]tmereader.Repository, httpClient httpClient, baseURL string, maxTmeRecords int, writerEndpoint string, writerWorkers int) Service
NewService - creates an instance of Service
type ServiceImpl ¶
type ServiceImpl struct {
// contains filtered or unexported fields
}
ServiceImpl - implements the interface above
func (*ServiceImpl) GetAllConcepts ¶
func (s *ServiceImpl) GetAllConcepts(endpoint string) (io.PipeReader, error)
GetAllConcepts - returns a stream of all concepts for an endpoint
func (*ServiceImpl) GetConceptByUUID ¶
func (s *ServiceImpl) GetConceptByUUID(endpoint, uuid string) (*BasicConcept, bool, error)
GetConceptByUUID - return a specific concept from a specific endpoint.
func (*ServiceImpl) GetConceptUUIDs ¶
func (s *ServiceImpl) GetConceptUUIDs(endpoint string) (io.PipeReader, error)
func (*ServiceImpl) GetCount ¶
func (s *ServiceImpl) GetCount(endpoint string) (int, error)
GetCount - returns record count for a specific endpoint
func (*ServiceImpl) GetLoadedTypes ¶
func (s *ServiceImpl) GetLoadedTypes() []string
GetLoadedTypes - returns a list of the loaded types, rather than assuming everything in the mapping.
func (*ServiceImpl) IsDataLoaded ¶
func (s *ServiceImpl) IsDataLoaded(endpoint string) bool
IsDataLoaded - is data for a specific endpoint loaded?
func (*ServiceImpl) RefreshConceptByUUID ¶
func (s *ServiceImpl) RefreshConceptByUUID(endpoint, uuid string) (*BasicConcept, bool, error)
RefreshConceptByUUID - updates and returns a specific concept.
func (*ServiceImpl) Reload ¶
func (s *ServiceImpl) Reload(endpoint string) error
Reload - Reloads the data for a specific endpoint
func (*ServiceImpl) SendConceptByUUID ¶
func (s *ServiceImpl) SendConceptByUUID(txID, endpoint, uuid string, ignoreHash bool) error
func (*ServiceImpl) SendConcepts ¶
func (s *ServiceImpl) SendConcepts(endpoint, jobID string, ignoreHash bool) error
type Transformer ¶
type Transformer struct { }
func (*Transformer) UnMarshallTaxonomy ¶
func (*Transformer) UnMarshallTaxonomy(contents []byte) ([]interface{}, error)
func (*Transformer) UnMarshallTerm ¶
func (*Transformer) UnMarshallTerm(content []byte) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.