models

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Affiliation

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

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() (errs validation.Errors)

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) 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) HasRelatedPublication

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

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() (errs validation.Errors)

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"`
}

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 []struct {
		ID string `json:"id,omitempty"`
	} `json:"tree,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"`
	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) CanChangeType added in v1.0.42

func (u *Person) CanChangeType(p *Publication) bool

func (*Person) CanCurate added in v1.0.42

func (u *Person) CanCurate() bool

func (*Person) CanDeleteDataset added in v1.0.42

func (u *Person) CanDeleteDataset(d *Dataset) bool

func (*Person) CanDeletePublication added in v1.0.42

func (u *Person) CanDeletePublication(p *Publication) bool

func (*Person) CanEditDataset added in v1.0.42

func (u *Person) CanEditDataset(d *Dataset) bool

func (*Person) CanEditPublication added in v1.0.42

func (u *Person) CanEditPublication(p *Publication) bool

func (*Person) CanImpersonateUser added in v1.0.42

func (u *Person) CanImpersonateUser() bool

func (*Person) CanViewDashboard added in v1.0.42

func (u *Person) CanViewDashboard() bool

func (*Person) CanViewDataset added in v1.0.42

func (u *Person) CanViewDataset(d *Dataset) bool

func (*Person) CanViewPublication added in v1.0.42

func (u *Person) CanViewPublication(p *Publication) bool

type Project

type Project struct {
	ID          string     `json:"_id,omitempty"`
	Title       string     `json:"title,omitempty"`
	StartDate   string     `json:"start_date,omitempty"`
	EndDate     string     `json:"end_date,omitempty"`
	DateCreated *time.Time `json:"date_created,omitempty"`
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	EUProject   *EUProject `json:"eu,omitempty"`
	GISMOID     string     `json:"gismo_id,omitempty"`
	IWETOID     string     `json:"iweto_id,omitempty"`
}

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) 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) 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

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) Validate

func (pf *PublicationFile) Validate() (errs validation.Errors)

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() (errs validation.Errors)

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:"-"`
}

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) HasFilter

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

func (*SearchArgs) HasSort

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

func (*SearchArgs) Limit

func (s *SearchArgs) Limit() int

func (*SearchArgs) Offset

func (s *SearchArgs) Offset() int

func (*SearchArgs) WithFacets

func (s *SearchArgs) WithFacets(facets ...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() (errs validation.Errors)

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