Documentation ¶
Index ¶
- Variables
- func NewDummyOrganization(id string) *models.Organization
- func NewDummyPerson(id string) *models.Person
- func NewDummyProject(id string) *models.Project
- type BulkIndexer
- type BulkIndexerConfig
- type DatasetGetter
- type DatasetIDIndex
- type DatasetIndex
- type DatasetListExporter
- type DatasetListExporterFactory
- type FileStore
- type HandleService
- type IndexSwitcher
- type LicenseSearchService
- type MediaTypeSearchService
- type Mutation
- type OrganizationSearchService
- type OrganizationService
- type PersonSearchService
- type PersonService
- type PersonWithOrganizationsService
- type ProjectSearchService
- type ProjectService
- type PublicationDecoder
- type PublicationDecoderFactory
- type PublicationEncoder
- type PublicationGetter
- type PublicationIDIndex
- type PublicationIndex
- type PublicationListExporter
- type PublicationListExporterFactory
- type Repository
- type SearchService
- type Services
- type UserSearchService
- type UserService
- type UserWithOrganizationsService
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("record not found")
Functions ¶
func NewDummyOrganization ¶ added in v1.0.35
func NewDummyOrganization(id string) *models.Organization
TODO remove this when we always have an uptodate db of organizations
func NewDummyPerson ¶ added in v1.0.35
func NewDummyProject ¶ added in v1.0.35
Types ¶
type BulkIndexer ¶ added in v1.0.22
type BulkIndexerConfig ¶ added in v1.0.22
type DatasetIDIndex ¶ added in v1.0.35
type DatasetIDIndex interface { Search(*models.SearchArgs) (*models.SearchHits, error) Each(searchArgs *models.SearchArgs, maxSize int, cb func(string)) error Delete(id string) error DeleteAll() error WithScope(string, ...string) DatasetIDIndex }
type DatasetIndex ¶ added in v1.0.35
type DatasetIndex interface { Search(*models.SearchArgs) (*models.DatasetHits, error) Each(searchArgs *models.SearchArgs, maxSize int, cb func(*models.Dataset)) error Delete(id string) error DeleteAll() error WithScope(string, ...string) DatasetIndex }
func NewDatasetIndex ¶ added in v1.0.35
func NewDatasetIndex(di DatasetIDIndex, r Repository) DatasetIndex
type DatasetListExporter ¶
type DatasetListExporterFactory ¶
type DatasetListExporterFactory func(io.Writer) DatasetListExporter
type IndexSwitcher ¶ added in v1.0.22
type LicenseSearchService ¶
type LicenseSearchService interface { IndexAll() error SuggestLicenses(string) ([]models.Completion, error) }
type MediaTypeSearchService ¶
type MediaTypeSearchService interface { IndexAll() error SuggestMediaTypes(string) ([]models.Completion, error) }
type OrganizationSearchService ¶
type OrganizationSearchService interface {
SuggestOrganizations(string) ([]models.Completion, error)
}
type OrganizationService ¶
type OrganizationService interface {
GetOrganization(string) (*models.Organization, error)
}
type PersonSearchService ¶
type PersonWithOrganizationsService ¶ added in v1.0.35
type PersonWithOrganizationsService struct { PersonService PersonService OrganizationService OrganizationService }
type ProjectSearchService ¶
type ProjectSearchService interface {
SuggestProjects(string) ([]models.Completion, error)
}
type PublicationDecoder ¶
type PublicationDecoder interface {
Decode(*models.Publication) error
}
type PublicationDecoderFactory ¶
type PublicationDecoderFactory func(io.Reader) PublicationDecoder
type PublicationEncoder ¶
type PublicationEncoder func(*models.Publication) ([]byte, error)
type PublicationGetter ¶
type PublicationGetter interface {
GetPublication(string) (*models.Publication, error)
}
type PublicationIDIndex ¶ added in v1.0.35
type PublicationIDIndex interface { Search(*models.SearchArgs) (*models.SearchHits, error) Each(searchArgs *models.SearchArgs, maxSize int, cb func(string)) error Delete(id string) error DeleteAll() error WithScope(string, ...string) PublicationIDIndex }
type PublicationIndex ¶ added in v1.0.35
type PublicationIndex interface { Search(*models.SearchArgs) (*models.PublicationHits, error) Each(searchArgs *models.SearchArgs, maxSize int, cb func(*models.Publication)) error Delete(id string) error DeleteAll() error WithScope(string, ...string) PublicationIndex }
func NewPublicationIndex ¶ added in v1.0.35
func NewPublicationIndex(di PublicationIDIndex, r Repository) PublicationIndex
type PublicationListExporter ¶
type PublicationListExporter interface { GetContentType() string Add(*models.Publication) Flush() error }
type PublicationListExporterFactory ¶
type PublicationListExporterFactory func(io.Writer) PublicationListExporter
type Repository ¶
type Repository interface { GetPublication(string) (*models.Publication, error) GetPublications([]string) ([]*models.Publication, error) SavePublication(*models.Publication, *models.User) error ImportPublication(*models.Publication) error UpdatePublication(string, *models.Publication, *models.User) error UpdatePublicationInPlace(*models.Publication) error MutatePublication(string, *models.User, ...Mutation) error PublicationsAfter(time.Time, int, int) (int, []*models.Publication, error) PublicationsBetween(time.Time, time.Time, func(*models.Publication) bool) error EachPublication(func(*models.Publication) bool) error EachPublicationSnapshot(func(*models.Publication) bool) error EachPublicationWithoutHandle(func(*models.Publication) bool) error PublicationHistory(string, func(*models.Publication) bool) error UpdatePublicationEmbargoes() (int, error) PurgeAllPublications() error PurgePublication(string) error GetDataset(string) (*models.Dataset, error) GetDatasets([]string) ([]*models.Dataset, error) ImportDataset(*models.Dataset) error SaveDataset(*models.Dataset, *models.User) error UpdateDataset(string, *models.Dataset, *models.User) error MutateDataset(string, *models.User, ...Mutation) error DatasetsAfter(time.Time, int, int) (int, []*models.Dataset, error) DatasetsBetween(time.Time, time.Time, func(*models.Dataset) bool) error EachDataset(func(*models.Dataset) bool) error EachDatasetSnapshot(func(*models.Dataset) bool) error EachDatasetWithoutHandle(func(*models.Dataset) bool) error DatasetHistory(string, func(*models.Dataset) bool) error UpdateDatasetEmbargoes() (int, error) PurgeAllDatasets() error PurgeDataset(string) error GetPublicationDatasets(*models.Publication) ([]*models.Dataset, error) GetVisiblePublicationDatasets(*models.User, *models.Publication) ([]*models.Dataset, error) GetDatasetPublications(*models.Dataset) ([]*models.Publication, error) GetVisibleDatasetPublications(*models.User, *models.Dataset) ([]*models.Publication, error) AddPublicationDataset(*models.Publication, *models.Dataset, *models.User) error RemovePublicationDataset(*models.Publication, *models.Dataset, *models.User) error }
type SearchService ¶ added in v1.0.35
type SearchService interface { NewDatasetIndex(Repository) DatasetIndex NewDatasetBulkIndexer(BulkIndexerConfig) (BulkIndexer[*models.Dataset], error) NewDatasetIndexSwitcher(BulkIndexerConfig) (IndexSwitcher[*models.Dataset], error) NewPublicationIndex(Repository) PublicationIndex NewPublicationBulkIndexer(BulkIndexerConfig) (BulkIndexer[*models.Publication], error) NewPublicationIndexSwitcher(BulkIndexerConfig) (IndexSwitcher[*models.Publication], error) }
type Services ¶
type Services struct { ORCIDSandbox bool ORCIDClient *orcid.MemberClient Repository Repository FileStore FileStore SearchService SearchService DatasetSearchIndex DatasetIndex PublicationSearchIndex PublicationIndex OrganizationService OrganizationService PersonService PersonService ProjectService ProjectService UserService UserService OrganizationSearchService OrganizationSearchService PersonSearchService PersonSearchService ProjectSearchService ProjectSearchService UserSearchService UserSearchService LicenseSearchService LicenseSearchService MediaTypeSearchService MediaTypeSearchService PublicationSources map[string]PublicationGetter DatasetSources map[string]DatasetGetter PublicationEncoders map[string]PublicationEncoder PublicationDecoders map[string]PublicationDecoderFactory PublicationListExporters map[string]PublicationListExporterFactory DatasetListExporters map[string]DatasetListExporterFactory HandleService HandleService }
type UserSearchService ¶
type UserService ¶
type UserWithOrganizationsService ¶ added in v1.0.35
type UserWithOrganizationsService struct { UserService UserService OrganizationService OrganizationService }
func (*UserWithOrganizationsService) GetUser ¶ added in v1.0.35
func (s *UserWithOrganizationsService) GetUser(id string) (*models.User, error)
func (*UserWithOrganizationsService) GetUserByUsername ¶ added in v1.0.35
func (s *UserWithOrganizationsService) GetUserByUsername(username string) (*models.User, error)
Directories ¶
Path | Synopsis |
---|---|
TODO use fs.FS
|
TODO use fs.FS |
TODO all mutating methods should call Validate() before saving
|
TODO all mutating methods should call Validate() before saving |
Click to show internal directories.
Click to hide internal directories.