Documentation
¶
Index ¶
- Constants
- type Author
- func (a Author) BirthName() string
- func (a Author) DateOfBirth() precisiondate.PrecisionDate
- func (a Author) DateOfDeath() precisiondate.PrecisionDate
- func (a Author) Description(language string) string
- func (a Author) Gender() float64
- func (a Author) Image() string
- func (a Author) InstanceOf() float64
- func (a Author) Pseudonyms() []string
- func (a Author) RetrievedOn() time.Time
- func (a Author) SourceID() string
- func (a Author) Website() string
- func (a Author) WikipediaLink(language string) string
- type EntitiesRequest
- type GetEntitiesRequest
- type GetEntitiesRequestMock
- type Gowikidata
- type GowikidataMock
- type SearchEntitiesRequest
- type SearchEntitiesRequestMock
- type WikidataSource
Constants ¶
View Source
const ( InstanceUnknown = iota InstanceHuman InstancePseudonym InstancePenName InstanceCollectivePseudonym InstanceHumanWhoseExistenceIsDisputed )
View Source
const ( GenderUnknown = iota GenderMale GenderFemale GenderIntersex GenderTrasgenderFemale GenderTrasgenderMale )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct {
// contains filtered or unexported fields
}
func (Author) DateOfBirth ¶
func (a Author) DateOfBirth() precisiondate.PrecisionDate
func (Author) DateOfDeath ¶
func (a Author) DateOfDeath() precisiondate.PrecisionDate
func (Author) Description ¶
func (Author) InstanceOf ¶
func (Author) Pseudonyms ¶
func (Author) RetrievedOn ¶
func (Author) WikipediaLink ¶
type EntitiesRequest ¶
type EntitiesRequest struct {
// contains filtered or unexported fields
}
func (EntitiesRequest) Get ¶
func (e EntitiesRequest) Get() (*map[string]gowikidata.Entity, error)
func (EntitiesRequest) SetLanguages ¶
func (e EntitiesRequest) SetLanguages(languages []string)
func (EntitiesRequest) SetProps ¶
func (e EntitiesRequest) SetProps(props []string)
type GetEntitiesRequest ¶
type GetEntitiesRequestMock ¶
type GetEntitiesRequestMock struct {
SetPropsFn func(props []string)
SetLanguagesFn func(languages []string)
GetFn func() (*map[string]gowikidata.Entity, error)
}
func (GetEntitiesRequestMock) Get ¶
func (e GetEntitiesRequestMock) Get() (*map[string]gowikidata.Entity, error)
func (GetEntitiesRequestMock) SetLanguages ¶
func (e GetEntitiesRequestMock) SetLanguages(languages []string)
func (GetEntitiesRequestMock) SetProps ¶
func (e GetEntitiesRequestMock) SetProps(props []string)
type Gowikidata ¶
type Gowikidata struct {
}
func (Gowikidata) NewGetEntities ¶
func (w Gowikidata) NewGetEntities(ids []string) (GetEntitiesRequest, error)
func (Gowikidata) NewSearch ¶
func (w Gowikidata) NewSearch(search string, language string) (SearchEntitiesRequest, error)
type GowikidataMock ¶
type GowikidataMock struct {
NewSearchFn func(search string, language string) (SearchEntitiesRequest, error)
NewGetEntitiesFn func(ids []string) (GetEntitiesRequest, error)
}
func (GowikidataMock) NewGetEntities ¶
func (w GowikidataMock) NewGetEntities(ids []string) (GetEntitiesRequest, error)
func (GowikidataMock) NewSearch ¶
func (w GowikidataMock) NewSearch(search string, language string) (SearchEntitiesRequest, error)
type SearchEntitiesRequest ¶
type SearchEntitiesRequest interface {
Get() (*gowikidata.SearchEntitiesResponse, error)
}
type SearchEntitiesRequestMock ¶
type SearchEntitiesRequestMock struct {
GetFn func() (*gowikidata.SearchEntitiesResponse, error)
}
func (SearchEntitiesRequestMock) Get ¶
func (e SearchEntitiesRequestMock) Get() (*gowikidata.SearchEntitiesResponse, error)
type WikidataSource ¶
type WikidataSource struct {
// contains filtered or unexported fields
}
func NewWikidataSource ¶
func NewWikidataSource(w wikidata) WikidataSource
func (WikidataSource) RetrieveAuthor ¶
RetrieveAuthor returns the first match from the list of passed Wikidata entity IDs that represents a human
func (WikidataSource) SearchAuthor ¶
Click to show internal directories.
Click to hide internal directories.