models

package
v1.0.61 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CollapseFromFacetLine = 2

Variables

View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrUserNotFound = errors.New("user not found")

Functions

This section is empty.

Types

type Affiliation

type Affiliation struct {
	OrganizationID string        `json:"organization_id"`
	Organization   *Organization `json:"-"`
}

type CandidateRecord added in v1.0.56

type CandidateRecord struct {
	ID             string          `json:"id"`
	SourceName     string          `json:"source_name"`
	SourceID       string          `json:"source_id"`
	SourceMetadata []byte          `json:"source_metadata"`
	Type           string          `json:"type"`
	Metadata       json.RawMessage `json:"metadata"`
	Status         string          `json:"status"`
	DateCreated    time.Time       `json:"date_created"`
	// this is the Metadata mapped to a publication in-memory, not stored in DB
	// TODO tightly coupled with Publication for now, refactor later
	Publication    *Publication `json:"publication"`
	StatusDate     *time.Time   `json:"status_date"`
	StatusPersonID string       `json:"status_person_id"`
	StatusPerson   *Person      `json:"status_person"`
	ImportedID     string       `json:"imported_id"`
}

type Completion

type Completion struct {
	ID          string `json:"id"`
	Heading     string `json:"heading"`
	Description string `json:"description"`
}

type Contributor

type Contributor struct {
	PersonID       string          `json:"person_id,omitempty"`
	Person         *Person         `json:"-"`
	ExternalPerson *ExternalPerson `json:"external_person,omitempty"`
	CreditRole     []string        `json:"credit_role,omitempty"`
}

func ContributorFromFirstLastName

func ContributorFromFirstLastName(fn, ln string) *Contributor

func ContributorFromPerson

func ContributorFromPerson(p *Person) *Contributor

func (*Contributor) FirstName

func (c *Contributor) FirstName() string

func (*Contributor) LastName

func (c *Contributor) LastName() string

func (*Contributor) Name

func (c *Contributor) Name() string

func (*Contributor) ORCID

func (c *Contributor) ORCID() string

func (*Contributor) Validate

func (c *Contributor) Validate() error

type Dataset

type Dataset struct {
	Abstract    []*Text        `json:"abstract,omitempty"`
	AccessLevel string         `json:"access_level,omitempty"`
	Author      []*Contributor `json:"author,omitempty"` // TODO rename to Creator
	// CompletenessScore  int                  `json:"completeness_score,omitempty"`
	BatchID                 string                 `json:"batch_id,omitempty"`
	Contributor             []*Contributor         `json:"contributor,omitempty"`
	CreatorID               string                 `json:"creator_id,omitempty"`
	Creator                 *Person                `json:"-"`
	DateCreated             *time.Time             `json:"date_created,omitempty"`
	DateUpdated             *time.Time             `json:"date_updated,omitempty"`
	DateFrom                *time.Time             `json:"date_from,omitempty"`
	DateUntil               *time.Time             `json:"date_until,omitempty"`
	EmbargoDate             string                 `json:"embargo_date,omitempty"`
	AccessLevelAfterEmbargo string                 `json:"access_level_after_embargo,omitempty"`
	Format                  []string               `json:"format,omitempty"`
	Handle                  string                 `json:"handle,omitempty"`
	ID                      string                 `json:"id,omitempty"`
	Identifiers             Values                 `json:"identifiers,omitempty"`
	Keyword                 []string               `json:"keyword,omitempty"`
	HasBeenPublic           bool                   `json:"has_been_public"`
	Language                []string               `json:"language,omitempty"`
	LastUserID              string                 `json:"last_user_id,omitempty"`
	LastUser                *Person                `json:"-"`
	License                 string                 `json:"license,omitempty"`
	Link                    []*DatasetLink         `json:"link,omitempty"`
	Locked                  bool                   `json:"locked"`
	Message                 string                 `json:"message,omitempty"`
	OtherLicense            string                 `json:"other_license,omitempty"`
	Publisher               string                 `json:"publisher,omitempty"`
	RelatedOrganizations    []*RelatedOrganization `json:"related_organizations,omitempty"`
	RelatedProjects         []*RelatedProject      `json:"related_projects,omitempty"`
	RelatedPublication      []RelatedPublication   `json:"related_publication,omitempty"`
	ReviewerNote            string                 `json:"reviewer_note,omitempty"`
	ReviewerTags            []string               `json:"reviewer_tags,omitempty"`
	SnapshotID              string                 `json:"snapshot_id,omitempty"`
	Status                  string                 `json:"status,omitempty"`
	Title                   string                 `json:"title,omitempty"`
	UserID                  string                 `json:"user_id,omitempty"`
	User                    *Person                `json:"-"`
	Year                    string                 `json:"year,omitempty"`
}

func (*Dataset) AddAbstract

func (d *Dataset) AddAbstract(t *Text)

func (*Dataset) AddContributor

func (d *Dataset) AddContributor(role string, c *Contributor)
func (d *Dataset) AddLink(l *DatasetLink)

func (*Dataset) AddOrganization

func (d *Dataset) AddOrganization(org *Organization)

func (*Dataset) AddProject

func (d *Dataset) AddProject(project *Project)

func (*Dataset) ClearEmbargo

func (d *Dataset) ClearEmbargo()

func (*Dataset) Contributors

func (d *Dataset) Contributors(role string) []*Contributor

func (*Dataset) FirstIdentifier added in v1.0.56

func (d *Dataset) FirstIdentifier() (string, []string)

func (*Dataset) GetAbstract

func (d *Dataset) GetAbstract(id string) *Text

func (*Dataset) GetContributor

func (d *Dataset) GetContributor(role string, i int) (*Contributor, error)
func (d *Dataset) GetLink(id string) *DatasetLink

func (*Dataset) HasContributor added in v1.0.56

func (d *Dataset) HasContributor(role string, u *Person) bool

func (*Dataset) HasRelatedPublication

func (d *Dataset) HasRelatedPublication(id string) bool

func (*Dataset) IdentifierType added in v1.0.56

func (d *Dataset) IdentifierType() string

TODO: remove when we really support multiple identifiers

func (*Dataset) IdentifierValue added in v1.0.56

func (d *Dataset) IdentifierValue() string

TODO: remove when we really support multiple identifiers

func (*Dataset) RemoveAbstract

func (d *Dataset) RemoveAbstract(id string)

func (*Dataset) RemoveContributor

func (d *Dataset) RemoveContributor(role string, i int) error
func (d *Dataset) RemoveLink(id string)

func (*Dataset) RemoveOrganization

func (d *Dataset) RemoveOrganization(id string)

func (*Dataset) RemoveProject

func (d *Dataset) RemoveProject(id string)

func (*Dataset) RemoveRelatedPublication

func (d *Dataset) RemoveRelatedPublication(id string)

func (*Dataset) SetAbstract

func (d *Dataset) SetAbstract(t *Text)

func (*Dataset) SetContributor

func (d *Dataset) SetContributor(role string, i int, c *Contributor) error

func (*Dataset) SetContributors

func (d *Dataset) SetContributors(role string, c []*Contributor)
func (d *Dataset) SetLink(l *DatasetLink)

func (*Dataset) Validate

func (d *Dataset) Validate() error

type DatasetHits

type DatasetHits struct {
	pagination.Pagination
	Hits   []*Dataset             `json:"hits"`
	Facets map[string]FacetValues `json:"facets"`
}
type DatasetLink struct {
	ID          string `json:"id,omitempty"`
	URL         string `json:"url,omitempty"`
	Relation    string `json:"relation,omitempty"`
	Description string `json:"description,omitempty"`
}

func (*DatasetLink) Validate

func (dl *DatasetLink) Validate() error

type EUProject

type EUProject struct {
	ID                 string
	Acronym            string
	CallID             string
	FrameworkProgramme string
}

type ExternalPerson

type ExternalPerson struct {
	FullName  string `json:"full_name,omitempty"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	// TODO forms are not yet aware of these new fields
	HonorificPrefix string `json:"honorific_prefix,omitempty"`
	Affiliation     string `json:"affiliation,omitempty"`
}

type Facet

type Facet struct {
	Value string `json:"value"`
	Count int    `json:"count"`
}

type FacetValues

type FacetValues []Facet

func (FacetValues) HasMatches

func (fv FacetValues) HasMatches() bool

type Handle

type Handle struct {
	Handle       string         `json:"handle"`
	ResponseCode int            `json:"responseCode"`
	Values       []*HandleValue `json:"values,omitempty"`
	Message      string         `json:"message,omitempty"`
}

func (*Handle) GetFullHandleURL

func (h *Handle) GetFullHandleURL() string

func (*Handle) IsSuccess

func (h *Handle) IsSuccess() bool

type HandleData

type HandleData struct {
	Url    string `json:"url"`
	Format string `json:"format"`
}

copy from handle-server-api

type HandleValue

type HandleValue struct {
	Timestamp string      `json:"timestamp"`
	Type      string      `json:"type"`
	Index     int         `json:"index"`
	Ttl       int         `json:"ttl"`
	Data      *HandleData `json:"data"`
}

type Organization

type Organization struct {
	ID   string                    `json:"id,omitempty"`
	Name string                    `json:"name,omitempty"`
	Tree []OrganizationTreeElement `json:"tree,omitempty"`
}

type OrganizationTreeElement added in v1.0.56

type OrganizationTreeElement struct {
	ID string `json:"id,omitempty"`
}

type Person

type Person struct {
	Active       bool           `json:"active"`
	DateCreated  *time.Time     `json:"date_created"`
	DateUpdated  *time.Time     `json:"date_updated"`
	Affiliations []*Affiliation `json:"affiliations"`
	Email        string         `json:"email"`
	FirstName    string         `json:"first_name"`
	FullName     string         `json:"full_name"`
	ID           string         `json:"id"`
	IDs          []string       `json:"ids"`
	LastName     string         `json:"last_name"`
	ORCID        string         `json:"orcid"`
	UGentID      []string       `json:"ugent_id"`
	// fields below are only relevant for Active people (users)
	Username   string `json:"username"`
	Role       string `json:"role"`
	ORCIDToken string `json:"orcid_token"`
}

func (*Person) AffiliatedWith added in v1.0.59

func (p *Person) AffiliatedWith(orgID string) bool

type Project

type Project struct {
	ID          string
	Title       string
	Description string
	Acronym     string
	StartDate   string
	EndDate     string
	DateCreated *time.Time
	DateUpdated *time.Time
	EUProject   *EUProject
	GISMOID     string
	IWETOID     string
}

type Publication

type Publication struct {
	Abstract         []*Text        `json:"abstract,omitempty"`
	AdditionalInfo   string         `json:"additional_info,omitempty"`
	AlternativeTitle []string       `json:"alternative_title,omitempty"`
	ArticleNumber    string         `json:"article_number,omitempty"`
	ArxivID          string         `json:"arxiv_id,omitempty"`
	Author           []*Contributor `json:"author,omitempty"`
	BatchID          string         `json:"batch_id,omitempty"`
	Classification   string         `json:"classification,omitempty"`
	// CompletenessScore       int                     `json:"completeness_score,omitempty"`
	ConferenceName      string     `json:"conference_name,omitempty"`
	ConferenceLocation  string     `json:"conference_location,omitempty"`
	ConferenceOrganizer string     `json:"conference_organizer,omitempty"`
	ConferenceStartDate string     `json:"conference_start_date,omitempty"`
	ConferenceEndDate   string     `json:"conference_end_date,omitempty"`
	ConferenceType      string     `json:"conference_type,omitempty"`
	CreatorID           string     `json:"creator_id,omitempty"`
	Creator             *Person    `json:"-"`
	DateCreated         *time.Time `json:"date_created,omitempty"`
	DateUpdated         *time.Time `json:"date_updated,omitempty"`
	DateFrom            *time.Time `json:"date_from,omitempty"`
	DateUntil           *time.Time `json:"date_until,omitempty"`
	DefenseDate         string     `json:"defense_date,omitempty"`
	DefensePlace        string     `json:"defense_place,omitempty"`
	// DefenseTime is deprecated, see https://github.com/ugent-library/biblio-backoffice/issues/1058
	DefenseTime             string                 `json:"defense_time,omitempty"`
	DOI                     string                 `json:"doi,omitempty"`
	Edition                 string                 `json:"edition,omitempty"`
	Editor                  []*Contributor         `json:"editor,omitempty"`
	EISBN                   []string               `json:"eisbn,omitempty"`
	EISSN                   []string               `json:"eissn,omitempty"`
	ESCIID                  string                 `json:"esci_id,omitempty"`
	Extern                  bool                   `json:"extern"`
	ExternalFields          Values                 `json:"external_fields,omitempty"`
	File                    []*PublicationFile     `json:"file,omitempty"`
	Handle                  string                 `json:"handle,omitempty"`
	HasConfidentialData     string                 `json:"has_confidential_data,omitempty"`
	HasPatentApplication    string                 `json:"has_patent_application,omitempty"`
	HasPublicationsPlanned  string                 `json:"has_publications_planned,omitempty"`
	HasPublishedMaterial    string                 `json:"has_published_material,omitempty"`
	ID                      string                 `json:"id,omitempty"`
	ISBN                    []string               `json:"isbn,omitempty"`
	ISSN                    []string               `json:"issn,omitempty"`
	Issue                   string                 `json:"issue,omitempty"`
	IssueTitle              string                 `json:"issue_title,omitempty"`
	JournalArticleType      string                 `json:"journal_article_type,omitempty"`
	Keyword                 []string               `json:"keyword,omitempty"`
	Language                []string               `json:"language,omitempty"`
	LastUserID              string                 `json:"last_user_id,omitempty"`
	LastUser                *Person                `json:"-"`
	LaySummary              []*Text                `json:"lay_summary,omitempty"`
	Legacy                  bool                   `json:"legacy"`
	Link                    []*PublicationLink     `json:"link,omitempty"`
	Locked                  bool                   `json:"locked"`
	Message                 string                 `json:"message,omitempty"`
	MiscellaneousType       string                 `json:"miscellaneous_type,omitempty"`
	ORCIDWork               []PublicationORCIDWork `json:"orcid_work,omitempty"`
	PageCount               string                 `json:"page_count,omitempty"`
	PageFirst               string                 `json:"page_first,omitempty"`
	PageLast                string                 `json:"page_last,omitempty"`
	PlaceOfPublication      string                 `json:"place_of_publication,omitempty"`
	Publication             string                 `json:"publication,omitempty"`
	PublicationAbbreviation string                 `json:"publication_abbreviation,omitempty"`
	PublicationStatus       string                 `json:"publication_status,omitempty"`
	Publisher               string                 `json:"publisher,omitempty"`
	PubMedID                string                 `json:"pubmed_id,omitempty"`
	RelatedDataset          []RelatedDataset       `json:"related_dataset,omitempty"`
	RelatedOrganizations    []*RelatedOrganization `json:"related_organizations,omitempty"`
	RelatedProjects         []*RelatedProject      `json:"related_projects,omitempty"`
	ReportNumber            string                 `json:"report_number,omitempty"`
	ResearchField           []string               `json:"research_field,omitempty"`
	ReviewerNote            string                 `json:"reviewer_note,omitempty"`
	ReviewerTags            []string               `json:"reviewer_tags,omitempty"`
	SeriesTitle             string                 `json:"series_title,omitempty"`
	SnapshotID              string                 `json:"snapshot_id,omitempty"`
	SourceDB                string                 `json:"source_db,omitempty"`
	SourceID                string                 `json:"source_id,omitempty"`
	SourceRecord            string                 `json:"source_record,omitempty"`
	Status                  string                 `json:"status,omitempty"`
	Supervisor              []*Contributor         `json:"supervisor,omitempty"`
	Title                   string                 `json:"title,omitempty"`
	Type                    string                 `json:"type,omitempty"`
	UserID                  string                 `json:"user_id,omitempty"`
	User                    *Person                `json:"-"`
	Volume                  string                 `json:"volume,omitempty"`
	VABBType                string                 `json:"vabb_type,omitempty"`
	VABBID                  string                 `json:"vabb_id,omitempty"`
	VABBApproved            bool                   `json:"vabb_approved"`
	VABBYear                []string               `json:"vabb_year,omitempty"`
	HasBeenPublic           bool                   `json:"has_been_public"`
	WOSID                   string                 `json:"wos_id,omitempty"`
	WOSType                 string                 `json:"wos_type,omitempty"`
	Year                    string                 `json:"year,omitempty"`
}

func (*Publication) AddAbstract

func (p *Publication) AddAbstract(t *Text)

func (*Publication) AddContributor

func (p *Publication) AddContributor(role string, c *Contributor)

func (*Publication) AddFile

func (p *Publication) AddFile(file *PublicationFile)

func (*Publication) AddLaySummary

func (p *Publication) AddLaySummary(t *Text)
func (p *Publication) AddLink(l *PublicationLink)

func (*Publication) AddOrganization

func (p *Publication) AddOrganization(org *Organization)

func (*Publication) AddProject

func (p *Publication) AddProject(project *Project)

func (*Publication) ChangeType

func (p *Publication) ChangeType(newType string)

func (*Publication) ClassificationChoices

func (p *Publication) ClassificationChoices() []string

func (*Publication) CleanupUnusedFields

func (p *Publication) CleanupUnusedFields() bool

func (*Publication) Contributors

func (p *Publication) Contributors(role string) []*Contributor

func (*Publication) FileIndex added in v1.0.42

func (p *Publication) FileIndex(id string) int

func (*Publication) GetAbstract

func (p *Publication) GetAbstract(id string) *Text

func (*Publication) GetContributor

func (p *Publication) GetContributor(role string, i int) (*Contributor, error)

func (*Publication) GetFile

func (p *Publication) GetFile(id string) *PublicationFile

func (*Publication) GetLaySummary

func (p *Publication) GetLaySummary(id string) *Text
func (p *Publication) GetLink(id string) *PublicationLink

func (*Publication) HasContributor added in v1.0.56

func (p *Publication) HasContributor(role string, u *Person) bool

func (*Publication) HasRelatedDataset

func (p *Publication) HasRelatedDataset(id string) bool

func (*Publication) InORCIDWorks

func (p *Publication) InORCIDWorks(orcidID string) bool

func (*Publication) MainFile

func (p *Publication) MainFile() *PublicationFile

NOTE this assumes publication_file_access_levels are ordered from most to least accessible

func (*Publication) PrimaryContributors added in v1.0.56

func (p *Publication) PrimaryContributors(role string, limit int) ([]*Contributor, bool)

func (*Publication) RemoveAbstract

func (p *Publication) RemoveAbstract(id string)

func (*Publication) RemoveContributor

func (p *Publication) RemoveContributor(role string, i int) error

func (*Publication) RemoveFile

func (p *Publication) RemoveFile(id string)

func (*Publication) RemoveLaySummary

func (p *Publication) RemoveLaySummary(id string)
func (p *Publication) RemoveLink(id string)

func (*Publication) RemoveOrganization

func (p *Publication) RemoveOrganization(id string)

func (*Publication) RemoveProject

func (p *Publication) RemoveProject(id string)

func (*Publication) RemoveRelatedDataset

func (p *Publication) RemoveRelatedDataset(id string)

func (*Publication) SetAbstract

func (p *Publication) SetAbstract(t *Text)

func (*Publication) SetContributor

func (p *Publication) SetContributor(role string, i int, c *Contributor) error

func (*Publication) SetContributors

func (p *Publication) SetContributors(role string, c []*Contributor)

func (*Publication) SetFile

func (p *Publication) SetFile(f *PublicationFile)

func (*Publication) SetLaySummary

func (p *Publication) SetLaySummary(ls *Text)
func (p *Publication) SetLink(l *PublicationLink)

func (*Publication) ShowDefenseAsRequired

func (p *Publication) ShowDefenseAsRequired() bool

func (*Publication) ShowPublicationAsRequired

func (p *Publication) ShowPublicationAsRequired() bool

func (*Publication) SummaryParts

func (p *Publication) SummaryParts() []string

Citation TODO this shouldn't be in the model

func (*Publication) UsesAbstract

func (p *Publication) UsesAbstract() bool

func (*Publication) UsesAdditionalInfo

func (p *Publication) UsesAdditionalInfo() bool

func (*Publication) UsesAlternativeTitle

func (p *Publication) UsesAlternativeTitle() bool

func (*Publication) UsesArticleNumber

func (p *Publication) UsesArticleNumber() bool

func (*Publication) UsesArxivID

func (p *Publication) UsesArxivID() bool

func (*Publication) UsesAuthor

func (p *Publication) UsesAuthor() bool

func (*Publication) UsesConference

func (p *Publication) UsesConference() bool

func (*Publication) UsesConferenceType

func (p *Publication) UsesConferenceType() bool

func (*Publication) UsesConfirmations

func (p *Publication) UsesConfirmations() bool

func (*Publication) UsesContributors

func (p *Publication) UsesContributors(role string) bool

func (*Publication) UsesDOI

func (p *Publication) UsesDOI() bool

func (*Publication) UsesDefense

func (p *Publication) UsesDefense() bool

func (*Publication) UsesESCIID

func (p *Publication) UsesESCIID() bool

func (*Publication) UsesEdition

func (p *Publication) UsesEdition() bool

func (*Publication) UsesEditor

func (p *Publication) UsesEditor() bool

func (*Publication) UsesISBN

func (p *Publication) UsesISBN() bool

func (*Publication) UsesISSN

func (p *Publication) UsesISSN() bool

func (*Publication) UsesIssue

func (p *Publication) UsesIssue() bool

func (*Publication) UsesJournalArticleType

func (p *Publication) UsesJournalArticleType() bool

func (*Publication) UsesKeyword

func (p *Publication) UsesKeyword() bool

func (*Publication) UsesLanguage

func (p *Publication) UsesLanguage() bool

func (*Publication) UsesLaySummary

func (p *Publication) UsesLaySummary() bool
func (p *Publication) UsesLink() bool

func (*Publication) UsesMiscellaneousType

func (p *Publication) UsesMiscellaneousType() bool

func (*Publication) UsesPage

func (p *Publication) UsesPage() bool

func (*Publication) UsesPageCount

func (p *Publication) UsesPageCount() bool

func (*Publication) UsesProject

func (p *Publication) UsesProject() bool

func (*Publication) UsesPubMedID

func (p *Publication) UsesPubMedID() bool

func (*Publication) UsesPublication

func (p *Publication) UsesPublication() bool

func (*Publication) UsesPublicationAbbreviation

func (p *Publication) UsesPublicationAbbreviation() bool

func (*Publication) UsesPublicationStatus

func (p *Publication) UsesPublicationStatus() bool

func (*Publication) UsesPublisher

func (p *Publication) UsesPublisher() bool

func (*Publication) UsesReportNumber

func (p *Publication) UsesReportNumber() bool

func (*Publication) UsesResearchField

func (p *Publication) UsesResearchField() bool

func (*Publication) UsesSeriesTitle

func (p *Publication) UsesSeriesTitle() bool

func (*Publication) UsesSupervisor

func (p *Publication) UsesSupervisor() bool

func (*Publication) UsesTitle

func (p *Publication) UsesTitle() bool

func (*Publication) UsesVolume

func (p *Publication) UsesVolume() bool

func (*Publication) UsesWOS

func (p *Publication) UsesWOS() bool

func (*Publication) UsesYear

func (p *Publication) UsesYear() bool

func (*Publication) VABB

func (p *Publication) VABB() string

format: c:vabb:419551, VABB-1, not approved, 2017

func (*Publication) Validate

func (p *Publication) Validate() error

type PublicationFile

type PublicationFile struct {
	AccessLevel              string     `json:"access_level,omitempty"`
	License                  string     `json:"license,omitempty"`
	ContentType              string     `json:"content_type,omitempty"`
	DateCreated              *time.Time `json:"date_created,omitempty"`
	DateUpdated              *time.Time `json:"date_updated,omitempty"`
	EmbargoDate              string     `json:"embargo_date,omitempty"`
	AccessLevelDuringEmbargo string     `json:"access_level_during_embargo,omitempty"`
	AccessLevelAfterEmbargo  string     `json:"access_level_after_embargo,omitempty"`
	Name                     string     `json:"name,omitempty"`
	Size                     int        `json:"size,omitempty"`
	ID                       string     `json:"id,omitempty"`
	SHA256                   string     `json:"sha256,omitempty"`
	OtherLicense             string     `json:"other_license,omitempty"`
	PublicationVersion       string     `json:"publication_version,omitempty"`
	Relation                 string     `json:"relation,omitempty"`
}

func (*PublicationFile) ClearEmbargo

func (pf *PublicationFile) ClearEmbargo()

func (*PublicationFile) IsUnderEmbargo added in v1.0.61

func (pf *PublicationFile) IsUnderEmbargo() (bool, error)

func (*PublicationFile) Validate

func (pf *PublicationFile) Validate() error

type PublicationHits

type PublicationHits struct {
	pagination.Pagination
	Hits   []*Publication         `json:"hits"`
	Facets map[string]FacetValues `json:"facets"`
}
type PublicationLink struct {
	ID          string `json:"id,omitempty"`
	URL         string `json:"url,omitempty"`
	Relation    string `json:"relation,omitempty"`
	Description string `json:"description,omitempty"`
}

func (*PublicationLink) Validate

func (pl *PublicationLink) Validate() error

type PublicationORCIDWork

type PublicationORCIDWork struct {
	ORCID   string `json:"orcid,omitempty"`
	PutCode int    `json:"put_code,omitempty"`
}

type RelatedDataset

type RelatedDataset struct {
	ID string `json:"id,omitempty"`
}

type RelatedOrganization

type RelatedOrganization struct {
	OrganizationID string        `json:"organization_id,omitempty"`
	Organization   *Organization `json:"-"`
}

type RelatedProject

type RelatedProject struct {
	ProjectID string   `json:"project_id,omitempty"`
	Project   *Project `json:"-"`
}

type RelatedPublication

type RelatedPublication struct {
	ID string `json:"id,omitempty"`
}

type SearchArgs

type SearchArgs struct {
	Query      string              `query:"q,omitempty"`
	Filters    map[string][]string `query:"f,omitempty"`
	Page       int                 `query:"page"`
	Sort       []string            `query:"sort,omitempty"`
	PageSize   int                 `query:"page-size"`
	Facets     []string            `query:"-"`
	FacetLines [][]string          `query:"-"`
}

func NewSearchArgs

func NewSearchArgs() *SearchArgs

func (*SearchArgs) Cleanup

func (s *SearchArgs) Cleanup()

func (*SearchArgs) Clone

func (s *SearchArgs) Clone() *SearchArgs

func (*SearchArgs) FilterFor

func (s *SearchArgs) FilterFor(field string) string

func (*SearchArgs) FiltersFor

func (s *SearchArgs) FiltersFor(field string) []string

func (*SearchArgs) HasActiveCollapsedFacets added in v1.0.56

func (s *SearchArgs) HasActiveCollapsedFacets() bool

func (*SearchArgs) HasFilter

func (s *SearchArgs) HasFilter(field string, terms ...string) bool

func (*SearchArgs) HasSort

func (s *SearchArgs) HasSort(sort string) bool

func (*SearchArgs) IsCollapsedFacet added in v1.0.56

func (s *SearchArgs) IsCollapsedFacet(field string) bool

func (*SearchArgs) Limit

func (s *SearchArgs) Limit() int

func (*SearchArgs) Offset

func (s *SearchArgs) Offset() int

func (*SearchArgs) WithFacetLines added in v1.0.56

func (s *SearchArgs) WithFacetLines(facetLines [][]string) *SearchArgs

func (*SearchArgs) WithFilter

func (s *SearchArgs) WithFilter(field string, terms ...string) *SearchArgs

func (*SearchArgs) WithPage

func (s *SearchArgs) WithPage(p int) *SearchArgs

func (*SearchArgs) WithPageSize

func (s *SearchArgs) WithPageSize(p int) *SearchArgs

func (*SearchArgs) WithQuery

func (s *SearchArgs) WithQuery(q string) *SearchArgs

func (*SearchArgs) WithSort

func (s *SearchArgs) WithSort(sort string) *SearchArgs

type SearchHits

type SearchHits struct {
	pagination.Pagination
	Hits   []string
	Facets map[string]FacetValues
}

type Text

type Text struct {
	Text string `json:"text,omitempty"`
	Lang string `json:"lang,omitempty"`
	ID   string `json:"id,omitempty"`
}

func (Text) Validate

func (t Text) Validate() error

type Values added in v1.0.41

type Values map[string][]string

func (Values) Add added in v1.0.41

func (v Values) Add(key, val string)

func (Values) Get added in v1.0.41

func (v Values) Get(key string) string

func (Values) GetAll added in v1.0.41

func (v Values) GetAll(key string) []string

func (Values) Has added in v1.0.41

func (v Values) Has(key, val string) bool

func (Values) Set added in v1.0.41

func (v Values) Set(key, val string)

func (Values) SetAll added in v1.0.41

func (v Values) SetAll(key string, vals ...string)

Jump to

Keyboard shortcuts

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