search

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 71 Imported by: 4

Documentation

Overview

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package search /*

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Center for Digital Matter HGK FHNW, Basel. Copyright 2020 info-age GmbH, Basel.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const DefaultDomain = "TRAEFIK DEFAULT CERT"

DefaultDomain Traefik domain for the default certificate.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, s string) []string

func CheckJWT

func CheckJWT(tokenstring string, secret string, alg []string, subject string) error

func CheckJWTValid

func CheckJWTValid(tokenstring string, secret string, alg []string) (map[string]interface{}, error)

func CheckRequestJWT

func CheckRequestJWT(req *http.Request, secret string, alg []string, subject string) error

func Compress

func Compress(data []byte) []byte

func CreateLogger

func CreateLogger(module string, logfile string, loglevel string) (log *logging.Logger, lf *os.File)

func Decompress

func Decompress(data []byte) ([]byte, error)

func DefaultCertificate

func DefaultCertificate() (*tls.Certificate, error)

DefaultCertificate generates random TLS certificates.

func FileExists

func FileExists(filename string) bool

func GUnzip

func GUnzip(data string) (string, error)

func GetClaim

func GetClaim(claim map[string]interface{}, name string) (string, error)

func Hash

func Hash(data interface{}) ([16]byte, error)

func InList

func InList(slice []string, s string) bool

func KeyPair

func KeyPair(domain string, expiration time.Time) ([]byte, []byte, error)

KeyPair generates cert and Key files.

func Min

func Min(a, b int64) int64

func NewJWT

func NewJWT(secret string, subject string, alg string, valid int64, domain string, issuer string, userId string) (tokenString string, err error)

func PemCert

func PemCert(privKey *rsa.PrivateKey, domain string, expiration time.Time) ([]byte, error)

PemCert generates PEM cert file.

func SingleJoiningSlash

func SingleJoiningSlash(a, b string) string

func TrimLength

func TrimLength(str string, length int, suffix string) string

func UrlAmp

func UrlAmp(u string, ampCache string, t string) (string, error)

Types

type ApiResult

type ApiResult struct {
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Result  interface{} `json:"result,omitempty"`
}

type BaseStatus

type BaseStatus struct {
	OGPNamespace  string
	OGPMeta       string
	JsonLD        string
	Type          string
	Notifications []Notification
	User          *User
	Self          string
	RawQuery      string
	Canonical     string
	Token         string
	BaseUrl       string
	Prefixes      map[string]string
	SelfPath      string
	RelPath       string
	AmpBase       string
	LoginUrl      string
	Title         string
	InstanceName  string

	Plain bool
	// contains filtered or unexported fields
}

func (BaseStatus) LinkCollections

func (bs BaseStatus) LinkCollections() string

func (BaseStatus) LinkSearch

func (bs BaseStatus) LinkSearch(query string, facets ...string) template.URL

func (BaseStatus) LinkSignature

func (bs BaseStatus) LinkSignature(signature string) string

func (BaseStatus) LinkSignatureCache

func (bs BaseStatus) LinkSignatureCache(signature string) string

func (BaseStatus) LinkSubject

func (bs BaseStatus) LinkSubject(area, sub, subject string, params ...string) string

type ClusterResultStatus

type ClusterResultStatus struct {
	BaseStatus
	SearchResultTotal int64
	SearchResultStart int64
	SearchResultRows  int64
	Items             []GoogleResultItem
	TotalResults      string
	SearchString      string
	Searches          []KV
	CSEBase           string
	SearchToken       string
	SearchName        string
}

type ClusterStatus

type ClusterStatus struct {
	BaseStatus

	SearchResult        template.JS
	Result              []*SourceData
	QueryApi            template.URL
	SearchResultStart   int
	SearchResultRows    int
	SearchResultTotal   int
	SearchResultVisible bool
	MetaDescription     string
}

type CollectionsStatus

type CollectionsStatus struct {
	BaseStatus

	SearchResult        template.JS
	Result              map[string][]*SourceData
	Areas               []string
	QueryApi            template.URL
	SearchResultStart   int
	SearchResultRows    int
	SearchResultTotal   int
	SearchResultVisible bool
	MetaDescription     string
}

type DetailStatus

type DetailStatus struct {
	BaseStatus
	Doc               *SourceData
	MetaPublic        bool
	ContentPublic     bool
	MetaOK            bool
	ContentOK         bool
	IsAmp             bool
	MetaDescription   string
	Result            *SearchResult
	SearchResultRows  int
	SearchResultTotal int
	FacebookAppId     string
	Plain             bool
}

type Document

type Document struct {
	Content *SourceData         `json:"content,omitempty"`
	ACL     map[string][]string `json:"acl,omitempty"`
	Id      string              `json:"id"`
	Source  string              `json:"source,omitempty"`
	Catalog []string            `json:"catalog,omitempty"`
	Tag     []string            `json:"tag,omitempty"`
	Error   string              `json:"error"`
}

type ErrorHTTPStatus

type ErrorHTTPStatus struct {
	// contains filtered or unexported fields
}

func (*ErrorHTTPStatus) Error

func (err *ErrorHTTPStatus) Error() string

type FacetCountField

type FacetCountField struct {
	Id        string
	Name      string
	ShortName string
	Selected  bool
}

type FacetCountResult

type FacetCountResult map[string]map[string]int

type FacetManager

type FacetManager struct {
	DefaultFacets SolrFacetList
	Facets        SolrFacetList
	// contains filtered or unexported fields
}

func NewFacetManager

func NewFacetManager(defaults SolrFacetList) *FacetManager

type GoogleResultItem

type GoogleResultItem struct {
	Title                           string
	Snippet                         string
	Thumbnail                       string
	ThumbnailWidth, ThumbnailHeight int64
	Domain                          string
	Link                            string
	Mimetype                        string
	FileFormat                      string
}

type GoogleResultStatus

type GoogleResultStatus struct {
	BaseStatus
	SearchName   string
	CX           string
	Searches     []string
	SearchString string
}

type ImageSearchStatus

type ImageSearchStatus struct {
	Type              string
	Notifications     []Notification
	User              *User
	Self              string
	Token             string
	BaseUrl           string
	SelfPath          string
	AmpBase           string
	LoginUrl          string
	Title             string
	SearchResult      template.JS
	Result            *SearchResult
	QueryApi          template.URL
	SearchResultStart int
	SearchResultRows  int
	SearchResultTotal int
	SearchString      string
	MetaDescription   string
}

type ItemDataBase

type ItemDataBase struct {
	Key          string           `json:"Key,omitempty"`
	Version      int64            `json:"version"`
	ItemType     string           `json:"itemType"`
	Tags         []ItemTag        `json:"tags"`
	Relations    RelationList     `json:"relations"`
	ParentItem   Parent           `json:"parentItem,omitempty"`
	Collections  []string         `json:"collections"`
	DateAdded    string           `json:"dateAdded,omitempty"`
	DateModified string           `json:"dateModified,omitempty"`
	Creators     []ItemDataPerson `json:"creators"`
	Media        ItemMedia        `json:"media,omitempty"`
}

type ItemDataPerson

type ItemDataPerson struct {
	CreatorType string `json:"creatorType"`
	FirstName   string `json:"firstName"`
	LastName    string `json:"lastName"`
}

type ItemGeneric

type ItemGeneric struct {
	ItemDataBase
	NumPages             string  `json:"numPages,omitempty"`             // # of Pages
	NumberOfVolumes      string  `json:"numberOfVolumes,omitempty"`      // # of Volumes
	AbstractNote         string  `json:"abstractNote,omitempty"`         // Abstract
	AccessDate           string  `json:"accessDate,omitempty"`           // Accessed
	ApplicationNumber    string  `json:"applicationNumber,omitempty"`    // Application Number
	Archive              string  `json:"archive,omitempty"`              // Archive
	ArtworkSize          string  `json:"artworkSize,omitempty"`          // Artwork Size
	Assignee             string  `json:"assignee,omitempty"`             // Assignee
	BillNumber           string  `json:"billNumber,omitempty"`           // Bill Number
	BlogTitle            string  `json:"blogTitle,omitempty"`            // Blog Title
	BookTitle            string  `json:"bookTitle,omitempty"`            // Book Title
	CallNumber           string  `json:"callNumber,omitempty"`           // Call Number
	CaseName             string  `json:"caseName,omitempty"`             // Case Name
	Code                 string  `json:"code,omitempty"`                 // Code
	CodeNumber           string  `json:"codeNumber,omitempty"`           // Code Number
	CodePages            string  `json:"codePages,omitempty"`            // Code Pages
	CodeVolume           string  `json:"codeVolume,omitempty"`           // Code Volume
	Committee            string  `json:"committee,omitempty"`            // Committee
	Company              string  `json:"company,omitempty"`              // Company
	ConferenceName       string  `json:"conferenceName,omitempty"`       // Conference Name
	Country              string  `json:"country,omitempty"`              // Country
	Court                string  `json:"court,omitempty"`                // Court
	DOI                  string  `json:"DOI,omitempty"`                  // DOI
	Date                 string  `json:"date,omitempty"`                 // Date
	DateDecided          string  `json:"dateDecided,omitempty"`          // Date Decided
	DateEnacted          string  `json:"dateEnacted,omitempty"`          // Date Enacted
	DictionaryTitle      string  `json:"dictionaryTitle,omitempty"`      // Dictionary Title
	Distributor          string  `json:"distributor,omitempty"`          // Distributor
	DocketNumber         string  `json:"docketNumber,omitempty"`         // Docket Number
	DocumentNumber       string  `json:"documentNumber,omitempty"`       // Document Number
	Edition              string  `json:"edition,omitempty"`              // Edition
	EncyclopediaTitle    string  `json:"encyclopediaTitle,omitempty"`    // Encyclopedia Title
	EpisodeNumber        string  `json:"episodeNumber,omitempty"`        // Episode Number
	Extra                string  `json:"extra,omitempty"`                // Extra
	AudioFileType        string  `json:"audioFileType,omitempty"`        // File Type
	FilingDate           string  `json:"filingDate,omitempty"`           // Filing Date
	FirstPage            string  `json:"firstPage,omitempty"`            // First Page
	AudioRecordingFormat string  `json:"audioRecordingFormat,omitempty"` // Format
	VideoRecordingFormat string  `json:"videoRecordingFormat,omitempty"` // Format
	ForumTitle           string  `json:"forumTitle,omitempty"`           // Forum/Listserv Title
	Genre                string  `json:"genre,omitempty"`                // Genre
	History              string  `json:"history,omitempty"`              // History
	ISBN                 string  `json:"ISBN,omitempty"`                 // ISBN
	ISSN                 string  `json:"ISSN,omitempty"`                 // ISSN
	Institution          string  `json:"institution,omitempty"`          // Institution
	Issue                string  `json:"issue,omitempty"`                // Issue
	IssueDate            string  `json:"issueDate,omitempty"`            // Issue Date
	IssuingAuthority     string  `json:"issuingAuthority,omitempty"`     // Issuing Authority
	JournalAbbreviation  string  `json:"journalAbbreviation,omitempty"`  // Journal Abbr
	Label                string  `json:"label,omitempty"`                // Label
	Language             string  `json:"language,omitempty"`             // Language
	ProgrammingLanguage  string  `json:"programmingLanguage,omitempty"`  // Language
	LegalStatus          string  `json:"legalStatus,omitempty"`          // Legal Status
	LegislativeBody      string  `json:"legislativeBody,omitempty"`      // Legislative Body
	LibraryCatalog       string  `json:"libraryCatalog,omitempty"`       // ZoteroLibrary Catalog
	ArchiveLocation      string  `json:"archiveLocation,omitempty"`      // Loc. in Archive
	InterviewMedium      string  `json:"interviewMedium,omitempty"`      // Medium
	ArtworkMedium        string  `json:"artworkMedium,omitempty"`        // Medium
	MeetingName          string  `json:"meetingName,omitempty"`          // Meeting Name
	NameOfAct            string  `json:"nameOfAct,omitempty"`            // Name of Act
	Network              string  `json:"network,omitempty"`              // Network
	Pages                float64 `json:"pages,omitempty"`                // Pages
	PatentNumber         string  `json:"patentNumber,omitempty"`         // Patent Number
	Place                string  `json:"place,omitempty"`                // Place
	PostType             string  `json:"postType,omitempty"`             // Post Type
	PriorityNumbers      string  `json:"priorityNumbers,omitempty"`      // Priority Numbers
	ProceedingsTitle     string  `json:"proceedingsTitle,omitempty"`     // Proceedings Title
	ProgramTitle         string  `json:"programTitle,omitempty"`         // Program Title
	PublicLawNumber      string  `json:"publicLawNumber,omitempty"`      // Public Law Number
	PublicationTitle     string  `json:"publicationTitle,omitempty"`     // Publication
	Publisher            string  `json:"publisher,omitempty"`            // Publisher
	References           string  `json:"references,omitempty"`           // References
	ReportNumber         string  `json:"reportNumber,omitempty"`         // Report Number
	ReportType           string  `json:"reportType,omitempty"`           // Report Type
	Reporter             string  `json:"reporter,omitempty"`             // Reporter
	ReporterVolume       string  `json:"reporterVolume,omitempty"`       // Reporter Volume
	Rights               string  `json:"rights,omitempty"`               // Rights
	RunningTime          string  `json:"runningTime,omitempty"`          // Running Time
	Scale                string  `json:"scale,omitempty"`                // Scale
	Section              string  `json:"section,omitempty"`              // Section
	Series               string  `json:"series,omitempty"`               // Series
	SeriesNumber         string  `json:"seriesNumber,omitempty"`         // Series Number
	SeriesText           string  `json:"seriesText,omitempty"`           // Series Text
	SeriesTitle          string  `json:"seriesTitle,omitempty"`          // Series Title
	Session              string  `json:"session,omitempty"`              // Session
	ShortTitle           string  `json:"shortTitle,omitempty"`           // Short Title
	Studio               string  `json:"studio,omitempty"`               // Studio
	Subject              string  `json:"subject,omitempty"`              // Subject
	System               string  `json:"system,omitempty"`               // System
	Title                string  `json:"title,omitempty"`                // Title
	ThesisType           string  `json:"thesisType,omitempty"`           // Type
	PresentationType     string  `json:"presentationType,omitempty"`     // Type
	MapType              string  `json:"mapType,omitempty"`              // Type
	ManuscriptType       string  `json:"manuscriptType,omitempty"`       // Type
	LetterType           string  `json:"letterType,omitempty"`           // Type
	Url                  string  `json:"url,omitempty"`                  // URL
	University           string  `json:"university,omitempty"`           // University
	VersionNumber        string  `json:"versionNumber,omitempty"`        // Version
	Volume               string  `json:"volume,omitempty"`               // Volume
	WebsiteTitle         string  `json:"websiteTitle,omitempty"`         // Website Title
	WebsiteType          string  `json:"websiteType,omitempty"`          // Website Type

	// Attachment
	LinkMode    string `json:"linkMode,omitempty"`
	Note        string `json:"note,omitempty"`
	ContentType string `json:"contentType,omitempty"`
	Charset     string `json:"charset,omitempty"`
	Filename    string `json:"filename,omitempty"`
	MD5         string `json:"md5,omitempty"`
	MTime       int64  `json:"mtime,omitempty"`
}

type ItemMedia

type ItemMedia struct {
	Metadata ItemMediaMeta `json:"metadata,omitempty"`
}

type ItemMediaMeta

type ItemMediaMeta struct {
	Mimetype string      `json:"mimetype"`
	Type     string      `json:"type"`
	Ext      string      `json:"ext,omitempty"`
	Sha256   string      `json:"sha256,omitempty"`
	Duration float64     `json:"duration,omitempty"`
	Width    float64     `json:"width,omitempty"`
	Height   float64     `json:"height,omitempty"`
	Video    interface{} `json:"video,omitempty"`
	Audio    interface{} `json:"audio,omitempty"`
	Image    interface{} `json:"image,omitempty"`
}

func (*ItemMediaMeta) UnmarshalJSON

func (imm *ItemMediaMeta) UnmarshalJSON(data []byte) error

type ItemTag

type ItemTag struct {
	Tag  string `json:"Tag"`
	Type int64  `json:"type,omitempty"`
}

type JSONData

type JSONData map[string]interface{}

type JSONDomainMap

type JSONDomainMap map[string]interface{}

func CreateJSONDomainMap

func CreateJSONDomainMap() *JSONDomainMap

func (*JSONDomainMap) SetBlockParentQuery

func (jdm *JSONDomainMap) SetBlockParentQuery(allParentsQuery string) *JSONDomainMap

*

  • Indicates that the resulting domain will contain all parent documents of the children in the existing domain *
  • @param allParentsQuery a query used to identify all parent documents in the collection

func (*JSONDomainMap) WithFilter

func (jdm *JSONDomainMap) WithFilter(filter string) *JSONDomainMap

*

  • Indicates that the domain should be narrowed by the specified filter *
  • May be called multiple times. Each added filter is retained and used to narrow the domain.

func (*JSONDomainMap) WithQuery

func (jdm *JSONDomainMap) WithQuery(query string) *JSONDomainMap

*

  • Indicates that the domain should be the following query *
  • May be called multiple times. Each specified query is retained and included in the domain.

func (*JSONDomainMap) WithTagsToExclude

func (jdm *JSONDomainMap) WithTagsToExclude(excludeTagsValue string) *JSONDomainMap

*

  • Provide a tag or tags that correspond to filters or queries to exclude from the domain *
  • May be called multiple times. Each exclude-string is retained and used for removing queries/filters from the
  • domain specification. *
  • @param excludeTagsValue a comma-delimited String containing filter/query tags to exclude

type JSONFacetMap

type JSONFacetMap map[string]interface{}

func CreateJSONFacetMap

func CreateJSONFacetMap(t string) *JSONFacetMap

type JSONHeatmapFacetMap

type JSONHeatmapFacetMap JSONFacetMap

func CreateJSONHeatmapFacetMap

func CreateJSONHeatmapFacetMap(fieldname string) *JSONHeatmapFacetMap

func (*JSONHeatmapFacetMap) SetDistErr

func (jfm *JSONHeatmapFacetMap) SetDistErr(distErr float64) *JSONHeatmapFacetMap

*

  • Indicates the maximum acceptable cell error distance. *
  • Used to compute the size of each cell in the heatmap grid rather than specifying {@link #setGridLevel(int)} *
  • @param distErr a positive value representing the maximum acceptable cell error. *
  • @see #setGridLevel(int)
  • @see #setDistErrPct(double)

func (*JSONHeatmapFacetMap) SetDistErrPct

func (jfm *JSONHeatmapFacetMap) SetDistErrPct(distErrPct float64) *JSONHeatmapFacetMap

*

  • A fraction of the heatmap region that is used to compute the cell size. *
  • Defaults to 0.15 if not specified. *
  • @see #setGridLevel(int)
  • @see #setDistErr(double)

func (*JSONHeatmapFacetMap) SetGridLevel

func (jfm *JSONHeatmapFacetMap) SetGridLevel(individualCellSize int64) *JSONHeatmapFacetMap

*

  • Indicates the size of each cell in the computed heatmap grid *
  • If not set, defaults to being computed by {@code distErrPct} or {@code distErr} *
  • @param individualCellSize the forced size of each cell in the heatmap grid *
  • @see #setDistErr(double)
  • @see #setDistErrPct(double)

func (*JSONHeatmapFacetMap) SetHeatmapFormat

func (jfm *JSONHeatmapFacetMap) SetHeatmapFormat(format string) *JSONHeatmapFacetMap

*

  • Sets the format that the computed heatmap should be returned in. *
  • Defaults to 'ints2D' if not specified.

func (*JSONHeatmapFacetMap) SetRegionQuery

func (jfm *JSONHeatmapFacetMap) SetRegionQuery(queryString string) *JSONHeatmapFacetMap

*

  • Indicate the region to compute the heatmap facet on. *
  • Defaults to the "world" ("[-180,-90 TO 180,90]")

type JSONQueryFacetMap

type JSONQueryFacetMap JSONFacetMap

func CreateJSONQueryFacetMap

func CreateJSONQueryFacetMap() *JSONQueryFacetMap

type JSONRangeFacetMap

type JSONRangeFacetMap JSONFacetMap

func CreateJSONRangeFacetMap

func CreateJSONRangeFacetMap(field string, start, end, gap interface{}) (*JSONRangeFacetMap, error)

func (*JSONRangeFacetMap) SetMinCount

func (jfm *JSONRangeFacetMap) SetMinCount(minOccurrences int64) *JSONRangeFacetMap

*

  • Indicates that buckets should be returned only if they have a count of at least {@code minOccurrences} *
  • Defaults to '0' if not specified.

func (*JSONRangeFacetMap) SetOtherBuckets

func (jfm *JSONRangeFacetMap) SetOtherBuckets(bucketSpecifier string) *JSONRangeFacetMap

*

  • Indicates that an additional range bucket(s) should be computed and added to those computed for {@code SearchResultStart} and {@code end} *
  • See {@link OtherBuckets} for possible options.

type JSONTermsFacetMap

func CreateJSONTermsFacetMap

func CreateJSONTermsFacetMap(field string) *JSONTermsFacetMap

func (*JSONTermsFacetMap) IncludeAllBucketsUnionBucket

func (jfm *JSONTermsFacetMap) IncludeAllBucketsUnionBucket(shouldInclude bool) *JSONTermsFacetMap

*

  • Creates a bucket representing the union of all other buckets. *
  • For multi-valued Fields this is different than a bucket for the entire domain, since documents can belong to
  • multiple buckets. Defaults to false if not specified. *
  • @param shouldInclude true if the union bucket "allBuckets" should be computed; false otherwise

func (*JSONTermsFacetMap) IncludeMissingBucket

func (jfm *JSONTermsFacetMap) IncludeMissingBucket(missingBucket bool) *JSONTermsFacetMap

*

  • Indicates that Solr should create a bucket corresponding to documents missing the field used by this facet. *
  • Defaults to false if not specified. *
  • @param missingBucket true if the special "missing" bucket should be created; false otherwise

func (*JSONTermsFacetMap) IncludeTotalNumBuckets

func (jfm *JSONTermsFacetMap) IncludeTotalNumBuckets(numBuckets bool) *JSONTermsFacetMap

*

  • Indicates that Solr should include the total number of buckets for this facet. *
  • Note that this is different than the number of buckets returned. Defaults to false if not specified *
  • @param numBuckets true if the "numBuckets" field should be computed; false otherwise

func (*JSONTermsFacetMap) JSONFacetMap

func (jfm *JSONTermsFacetMap) JSONFacetMap() *JSONFacetMap

func (*JSONTermsFacetMap) SetMinCount

func (jfm *JSONTermsFacetMap) SetMinCount(minCount int64) *JSONTermsFacetMap

*

  • Indicates that the facet results should not include any buckets with a count less than {@code minCount}. *
  • Defaults to 1 if not specified.

func (*JSONTermsFacetMap) SetOverRefine

func (jfm *JSONTermsFacetMap) SetOverRefine(numExtraBuckets int64) *JSONTermsFacetMap

*

  • Indicates how many extra buckets to request during distributed-facet-refining beyond those required by {@link #setLimit(int)} *
  • Defaults to -1 if not specified, which triggers some heuristic guessing based on other settings.

func (*JSONTermsFacetMap) SetOverRequest

func (jfm *JSONTermsFacetMap) SetOverRequest(numExtraBuckets int64) *JSONTermsFacetMap

*

  • Indicates the number of additional buckets to request internally beyond those required by {@link #setLimit(int)}. *
  • Defaults to -1 if not specified, which triggers some heuristic guessing based on other settings.

func (*JSONTermsFacetMap) SetPreliminarySort

func (jfm *JSONTermsFacetMap) SetPreliminarySort(preliminarySort string) *JSONTermsFacetMap

*

  • Indicates an approximate sort calculation to be performed during initial bucket generation and collection. *
  • Values can be based on 'count' (the number of results in each bucket), 'index' (the natural order of bucket values),
  • or on any stat facet that occurs in the bucket. Defaults to "count desc" if not specified. *
  • When no {@code prelim_sort} is provided, {@code sort} is calculated on all buckets generated by all shards. If
  • {@code sort} is expensive, {@code prelim_sort} can be used to provide a cheaper approximation calculation that is
  • run instead on initial bucket collection. {@code sort} is still used when assembling the final list of buckets. *
  • @see TermsFacetMap#setSort(String)

func (*JSONTermsFacetMap) SetTermPrefix

func (jfm *JSONTermsFacetMap) SetTermPrefix(termPrefix string) *JSONTermsFacetMap

*

  • Indicates that the facet should only produce buckets for terms that SearchResultStart with the specified Prefix.

func (*JSONTermsFacetMap) UseDistributedFacetRefining

func (jfm *JSONTermsFacetMap) UseDistributedFacetRefining(useRefining bool) *JSONTermsFacetMap

*

  • Indicates whether this facet should use distributed facet refining. *
  • "Distributed facet refining" is a second, optional stage in the facet process that ensures that counts for the
  • returned buckets are exact. Enabling it is a tradeoff between precision and speed/performance. Defaults to false
  • if not specified.
  • @param useRefining true if distributed facet refining should be used; false otherwise

type KV

type KV struct{ Key, Name string }

type MTElasticSearch

type MTElasticSearch struct {
	// contains filtered or unexported fields
}

func NewMTElasticSearch

func NewMTElasticSearch(urls []string, index string, apikey string, log zLogger.ZLogger) (*MTElasticSearch, error)

func (*MTElasticSearch) Delete

func (mte *MTElasticSearch) Delete(cfg *ScrollConfig) (int64, error)

func (*MTElasticSearch) LastUpdate

func (mte *MTElasticSearch) LastUpdate(cfg *ScrollConfig) (time.Time, error)

func (*MTElasticSearch) LoadDocs

func (mte *MTElasticSearch) LoadDocs(ids []string, ctx context.Context) (map[string]*SourceData, error)

func (*MTElasticSearch) Scroll

func (mte *MTElasticSearch) Scroll(cfg *ScrollConfig, callback func(data *SourceData) error) error

func (*MTElasticSearch) Search

func (mte *MTElasticSearch) Search(cfg *SearchConfig) ([]map[string][]string, []*SourceData, int64, FacetCountResult, error)

func (*MTElasticSearch) StatsByACL

func (mte *MTElasticSearch) StatsByACL(catalog []string) (int64, FacetCountResult, error)

func (*MTElasticSearch) Update

func (mte *MTElasticSearch) Update(source *SourceData) error

func (*MTElasticSearch) UpdateTimestamp

func (mte *MTElasticSearch) UpdateTimestamp(source *SourceData, timestamp time.Time) error

type Media

type Media struct {
	Name        string `json:"name"`
	Mimetype    string `json:"mimetype"`
	Type        string `json:"type"`
	Uri         string `json:"uri"`
	Width       int64  `json:"width,omitempty"`
	Height      int64  `json:"height,omitempty"`
	Orientation int64  `json:"orientation,omitempty"`
	Duration    int64  `json:"duration,omitempty"`
	Fulltext    string `json:"fulltext,omitempty"`
}

type MediaList

type MediaList []Media

func (MediaList) Len

func (ml MediaList) Len() int

func (MediaList) Less

func (ml MediaList) Less(i, j int) bool

func (MediaList) Swap

func (ml MediaList) Swap(i, j int)

type Metalist

type Metalist map[string]string

func (Metalist) MarshalJSON

func (ml Metalist) MarshalJSON() ([]byte, error)

func (*Metalist) UnmarshalJSON

func (ml *Metalist) UnmarshalJSON(b []byte) error

type NetGroups

type NetGroups map[string][]*net.IPNet

func (NetGroups) Contains

func (ng NetGroups) Contains(str string) []string

type Note

type Note struct {
	Title string        `json:"title"`
	Note  template.HTML `json:"note"`
}

type Notification

type Notification struct {
	Id      template.JS
	Message string
}

type OGData

type OGData map[string][]string

type Parent

type Parent string

zotero treats empty strings as false in ParentCollection

func (*Parent) UnmarshalJSON

func (pc *Parent) UnmarshalJSON(data []byte) error

type Person

type Person struct {
	Name string `json:"name"`
	Role string `json:"role"`
}

type Query

type Query struct {
	Label  string `json:"label"`
	Search string `json:"search"`
}

type Reference

type Reference struct {
	Type      string `json:"type"`
	Title     string `json:"title"`
	Signature string `json:"signature"`
}

type RelationList

type RelationList map[string][]string

Relations are empty array or string map

func (*RelationList) UnmarshalJSON

func (rl *RelationList) UnmarshalJSON(data []byte) error

type ScrollConfig

type ScrollConfig struct {
	Fields         map[string][]string
	QStr           string
	FiltersFields  map[string][]string
	Groups         []string
	ContentVisible bool
	IsAdmin        bool
}
type Search struct {
	sync.Mutex

	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(se SearchEngine, cachesize int, duration time.Duration, db *badger.DB, log zLogger.ZLogger) (*Search, error)

func (*Search) LoadEntities

func (s *Search) LoadEntities(ids []string) (map[string]*SourceData, error)

func (*Search) LoadEntity

func (s *Search) LoadEntity(id string) (*SourceData, error)

func (*Search) Search

func (s *Search) Search(cfg *SearchConfig) ([]map[string][]string, []*SourceData, int64, FacetCountResult, error)

func (*Search) StatsByACL

func (s *Search) StatsByACL(catalog []string) (int64, FacetCountResult, error)

type SearchConfig

type SearchConfig struct {
	Fields         map[string][]string
	QStr           string
	FiltersFields  map[string][]string
	Facets         map[string]TermFacet
	Groups         []string
	ContentVisible bool
	Start          int
	Rows           int
	IsAdmin        bool
}

type SearchEngine

type SearchEngine interface {
	Update(source *SourceData) error
	UpdateTimestamp(source *SourceData, timestamp time.Time) error
	LoadDocs(ids []string, ctx context.Context) (map[string]*SourceData, error)
	Search(cfg *SearchConfig) ([]map[string][]string, []*SourceData, int64, FacetCountResult, error)
	Delete(cfg *ScrollConfig) (int64, error)
	StatsByACL(catalog []string) (int64, FacetCountResult, error)
	LastUpdate(cfg *ScrollConfig) (time.Time, error)
	Scroll(cfg *ScrollConfig, f func(data *SourceData) error) error
}

type SearchResult

type SearchResult struct {
	Items           []SearchResultItem    `json:"items"`
	Total           int64                 `json:"total"`
	Start           int64                 `json:"SearchResultStart"`
	Rows            int64                 `json:"Rows"`
	Query           string                `json:"query"`
	Search          string                `json:"search"`
	Next            string                `json:"next"`
	FacetFieldCount map[string]facetField `json:"facetfieldcount"`
}

type SearchResultItem

type SearchResultItem struct {
	Id            string                     `json:"Id"`
	Type          string                     `json:"type"`
	Title         *translate.MultiLangString `json:"title"`
	Text          string                     `json:"text"`
	Collection    string                     `json:"collection"`
	Authors       []string                   `json:"authors"`
	AuthorText    string                     `json:"authortext"`
	Link          string                     `json:"link"`
	FirstItem     bool                       `json:"firstitem"`
	Total         int64                      `json:"total,omitempty"`
	Date          string                     `json:"date"`
	Icon          string                     `json:"icon"`
	Media         map[string]int             `json:"media"`
	MetaPublic    bool                       `json:"metapublic"`
	ContentPublic bool                       `json:"contentpublic"`
	MetaOK        bool                       `json:"metaok"`
	ContentOK     bool                       `json:"contentok"`
	Poster        *Media                     `json:"poster"`
	Highlight     map[string][]string        `json:"highlight"`
}

type SearchStatus

type SearchStatus struct {
	BaseStatus
	SearchResult        template.JS
	Result              *SearchResult
	QueryApi            template.URL
	SearchResultStart   int
	SearchResultRows    int
	SearchResultTotal   int
	SearchString        string
	Filter              map[string][]string
	SearchResultVisible bool
	Facet               map[string]map[string]FacetCountField
	CoreFacets          []string
	MetaDescription     string
	EmptySearch         bool
	Stats               FacetCountResult
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	service string,
	mts *Search,
	uc *UserCache,
	google *customsearch.Service,
	templateFiles map[string][]string,
	templateDev bool,
	InstanceName,
	addr, addrExt,
	mediaserver, mediaserverkey string,
	mediatokenexp time.Duration,
	log zLogger.ZLogger,
	accesslog io.Writer,
	prefixes map[string]string,
	staticDir,
	sitemapdir,
	staticCacheControl,
	templatedir,
	jwtKey string, jwtAlg []string,
	linkTokenExp,
	sessionTimeout time.Duration,
	loginUrl,
	loginIssuer,
	guestGroup,
	adminGroup,
	AmpCache,
	ampApiKeyFile string,
	searchFields map[string]string,
	facets SolrFacetList,
	locations NetGroups,
	icons map[string]string,
	baseCatalog []string,
	subFilter []SubFilter,
	collectionsCatalog,
	clusterCatalog string,
	googleCSEKey map[string]KV,
	facebookAppId string,
) (*Server, error)

func (*Server) DoPanic

func (s *Server) DoPanic(writer http.ResponseWriter, status int, message string) error

func (*Server) DoPanicJSON

func (s *Server) DoPanicJSON(writer http.ResponseWriter, status int, message string) (err error)

func (*Server) DoPanicf

func (s *Server) DoPanicf(user *User, req *http.Request, writer http.ResponseWriter, status int, message string, json bool, a ...interface{}) (err error)

func (*Server) GetClaimUser

func (s *Server) GetClaimUser(claims map[string]interface{}) (*User, error)

func (*Server) InitTemplates

func (s *Server) InitTemplates() (err error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(cert, key string) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type SolrFacet

type SolrFacet struct {
	Label    string          `json:"label,omitempty"`
	Name     string          `json:"Name,omitempty"`
	Field    string          `json:"field"`
	Prefix   string          `json:"Prefix,omitempty"`
	Restrict map[string]bool `json:"restrict,omitempty"`
}

func Create

func Create(Label, Name, Field, Prefix string, Restrict map[string]bool) (*SolrFacet, error)

type SolrFacetList

type SolrFacetList map[string]SolrFacet

type SolrResultJSONFacetBucket

type SolrResultJSONFacetBucket struct {
	Count int64  `json:"count"`
	Val   string `json:"val"`
}

func NewSolrResultJSONFacetBucket

func NewSolrResultJSONFacetBucket() (*SolrResultJSONFacetBucket, error)

func (*SolrResultJSONFacetBucket) Init

func (fb *SolrResultJSONFacetBucket) Init(data interface{}) error

type SolrResultJSONFacetElement

type SolrResultJSONFacetElement struct {
	//Name    string                      `json:"Name"`
	Buckets []*SolrResultJSONFacetBucket `json:"buckets"`
}

func NewSolrResultJSONFacetElement

func NewSolrResultJSONFacetElement() (*SolrResultJSONFacetElement, error)

func (*SolrResultJSONFacetElement) Init

func (fe *SolrResultJSONFacetElement) Init(data interface{}) error

type SolrResultJSONFacets

type SolrResultJSONFacets struct {
	Count    int64                                  `json:"count"`
	Elements map[string]*SolrResultJSONFacetElement `json:"elements"`
}

func NewSolrResultJSONFacets

func NewSolrResultJSONFacets() (*SolrResultJSONFacets, error)

func (*SolrResultJSONFacets) Init

func (fa *SolrResultJSONFacets) Init(data interface{}) error

type Source

type Source interface {
	GetSource() string
	GetSignature() string
	GetSignatureOriginal() string
	//Name() string
	GetTitle() *translate.MultiLangString
	GetSeries() string
	GetPlace() string
	GetDate() string
	GetCollectionTitle() string
	GetPersons() []Person
	GetACL() map[string][]string
	GetCatalogs() []string
	GetCategories() []string
	GetTags() []string
	GetMedia() map[string]MediaList
	GetPoster() *Media
	GetNotes() []Note
	GetUrl() string
	GetAbstract() *translate.MultiLangString
	GetRights() string
	GetLicense() string
	GetReferences() []Reference
	GetMeta() *Metalist
	GetExtra() *Metalist
	GetVars() *Varlist
	GetContentType() string
	GetQueries() []Query
	GetSolrDoc() *solr.Document
	GetContentString() string
	GetContentMime() string
	GetDateAdded() time.Time
	GetPublisher() string
}

type SourceData

type SourceData struct {
	Signature         string                     `json:"signature"`
	SignatureOriginal string                     `json:"signatureoriginal"`
	Source            string                     `json:"source"`
	Title             *translate.MultiLangString `json:"title"`
	Series            string                     `json:"series"`
	Place             string                     `json:"place"`
	Date              string                     `json:"date"`
	CollectionTitle   string                     `json:"collectiontitle"`
	Persons           []Person                   `json:"persons"`
	ACL               map[string][]string        `json:"acl"`
	Catalog           []string                   `json:"catalog"`
	Category          []string                   `json:"category"`
	Tags              []string                   `json:"tags"`
	Media             map[string]MediaList       `json:"media"`
	Poster            *Media                     `json:"poster"`
	Notes             []Note                     `json:"notes"`
	Url               string                     `json:"url"`
	Abstract          *translate.MultiLangString `json:"abstract"`
	References        []Reference                `json:"references"`
	Meta              *Metalist                  `json:"meta,omitempty"`
	Extra             *Metalist                  `json:"extra,omitempty"`
	Vars              *Varlist                   `json:"vars,omitempty"`
	Type              string                     `json:"type"`
	Queries           []Query                    `json:"queries,omitempty"`
	ContentStr        string                     `json:"-"`
	ContentMime       string                     `json:"-"`
	HasMedia          bool                       `json:"hasmedia"`
	Mediatype         []string                   `json:"mediatype"`
	DateAdded         time.Time                  `json:"dateadded"`
	Timestamp         time.Time                  `json:"timestamp"`
	Publisher         string                     `json:"publisher"`
	Rights            string                     `json:"rights"`
	License           string                     `json:"license"`
	Statistics        *SourceStatistic           `json:"statistics,omitempty"`
	TitleVector       []float32                  `json:"title_vector,omitempty"`
	ContentVector     []float32                  `json:"content_vector,omitempty"`
}

func NewSourceData

func NewSourceData(src Source) (*SourceData, error)

func (*SourceData) AddIdentifiers

func (sd *SourceData) AddIdentifiers(identifiers map[string]string)

func (*SourceData) CreateEmbedding added in v2.0.3

func (sd *SourceData) CreateEmbedding(embeddings *openai.ClientV2, tpl *template.Template, available []string)

func (*SourceData) GetACL

func (sd *SourceData) GetACL() map[string][]string

func (*SourceData) GetAbstract

func (sd *SourceData) GetAbstract() *translate.MultiLangString

func (*SourceData) GetCatalogs

func (sd *SourceData) GetCatalogs() []string

func (*SourceData) GetCategories

func (sd *SourceData) GetCategories() []string

func (*SourceData) GetCollectionTitle

func (sd *SourceData) GetCollectionTitle() string

func (*SourceData) GetContentMime

func (sd *SourceData) GetContentMime() string

func (*SourceData) GetContentString

func (sd *SourceData) GetContentString() string

func (*SourceData) GetContentType

func (sd *SourceData) GetContentType() string

func (*SourceData) GetDate

func (sd *SourceData) GetDate() string

func (*SourceData) GetDateAdded

func (sd *SourceData) GetDateAdded() time.Time

func (*SourceData) GetExtra

func (sd *SourceData) GetExtra() *Metalist

func (*SourceData) GetJsonLD

func (sd *SourceData) GetJsonLD(self string, mediaserver func(uri string, params ...string) (string, error)) (result interface{})

func (*SourceData) GetLicense

func (sd *SourceData) GetLicense() string

func (*SourceData) GetMedia

func (sd *SourceData) GetMedia() map[string]MediaList

func (*SourceData) GetMeta

func (sd *SourceData) GetMeta() *Metalist

func (*SourceData) GetNotes

func (sd *SourceData) GetNotes() []Note

func (*SourceData) GetOpenGraph

func (sd *SourceData) GetOpenGraph(app_id, self string, mediaserver func(uri string, params ...string) (string, error)) (namespace string, ogstr string)

func (*SourceData) GetPersons

func (sd *SourceData) GetPersons() []Person

func (*SourceData) GetPlace

func (sd *SourceData) GetPlace() string

func (*SourceData) GetPoster

func (sd *SourceData) GetPoster() *Media

func (*SourceData) GetPublisher

func (sd *SourceData) GetPublisher() string

func (*SourceData) GetQueries

func (sd *SourceData) GetQueries() []Query

func (*SourceData) GetReferences

func (sd *SourceData) GetReferences() []Reference

func (*SourceData) GetRights

func (sd *SourceData) GetRights() string

func (*SourceData) GetSeries

func (sd *SourceData) GetSeries() string

func (*SourceData) GetSignature

func (sd *SourceData) GetSignature() string

func (*SourceData) GetSignatureOriginal

func (sd *SourceData) GetSignatureOriginal() string

func (*SourceData) GetSolrDoc

func (sd *SourceData) GetSolrDoc() *solr.Document

func (*SourceData) GetSource

func (sd *SourceData) GetSource() string

func (*SourceData) GetTags

func (sd *SourceData) GetTags() []string

func (*SourceData) GetTitle

func (sd *SourceData) GetTitle() *translate.MultiLangString

func (*SourceData) GetUrl

func (sd *SourceData) GetUrl() string

func (*SourceData) GetVars

func (sd *SourceData) GetVars() *Varlist

func (*SourceData) Name

func (sd *SourceData) Name() string

func (*SourceData) SetStatistics

func (sd *SourceData) SetStatistics()

func (*SourceData) Translate

func (sd *SourceData) Translate(tr translate.Translator, langs []language.Tag)

type SourceStatistic

type SourceStatistic struct {
	MediaMimeType map[string][]string `json:"mediaMimeType"`
	MediaWidth    map[string][]int64  `json:"mediaWidth"`
	MediaHeight   map[string][]int64  `json:"mediaHeight"`
	MediaDuration map[string][]int64  `json:"mediaDuration"`
	MediaUri      map[string][]string `json:"mediaUri"`
	MediaType     []string            `json:"mediaType"`
	MediaCount    map[string]int64    `json:"mediaCount"`
	Person        []string            `json:"person"`
	Role          []string            `json:"role"`
}

type SubFilter

type SubFilter struct {
	Name   string `toml:"Name"`
	Label  string `toml:"label"`
	Filter string `toml:"filter"`
}

type TermFacet

type TermFacet struct {
	Selected map[string]bool
	Prefix   string
	Limit    int64
}

type User

type User struct {
	Server    *Server   `json:"-"`
	Id        string    `json:"Id"`
	Groups    []string  `json:"Groups"`
	Email     string    `json:"email"`
	FirstName string    `json:"firstName"`
	LastName  string    `json:"lastName"`
	HomeOrg   string    `json:"homeOrg"`
	Exp       time.Time `json:"exp"`
	LoggedIn  bool      `json:"loggedIn"`
	LoggedOut bool      `json:"loggedOut"`
}

func NewGuestUser

func NewGuestUser(s *Server) *User

func (User) LinkCollections

func (u User) LinkCollections() string

func (User) LinkSearch

func (u User) LinkSearch(query string, facets ...string) template.URL

func (User) LinkSignature

func (u User) LinkSignature(signature string) string

func (User) LinkSignatureCache

func (u User) LinkSignatureCache(signature string) string

func (User) LinkSubject

func (u User) LinkSubject(area, sub, subject string, params ...string) string

type UserCache

type UserCache struct {
	// contains filtered or unexported fields
}

func NewUserCache

func NewUserCache(idleTimeout time.Duration, initialSize int) (*UserCache, error)

func (*UserCache) GetUser

func (uc *UserCache) GetUser(id string) (*User, error)

func (*UserCache) SetUser

func (uc *UserCache) SetUser(user *User, index string) error

type Varlist

type Varlist map[string][]string

func (Varlist) Append

func (vl Varlist) Append(key string, values []string)

func (Varlist) AppendMap

func (vl Varlist) AppendMap(mv map[string][]string)

func (Varlist) MarshalJSON

func (vl Varlist) MarshalJSON() ([]byte, error)

func (Varlist) Unique

func (vl Varlist) Unique() *Varlist

func (*Varlist) UnmarshalJSON

func (vl *Varlist) UnmarshalJSON(b []byte) error

type ZoteroCollection

type ZoteroCollection struct {
	Key     string               `json:"Key"`
	Version int64                `json:"version"`
	Library ZoteroLibrary        `json:"library,omitempty"`
	Links   interface{}          `json:"links,omitempty"`
	Meta    ZoteroCollectionMeta `json:"meta,omitempty"`
	Data    ZoteroCollectionData `json:"data,omitempty"`
	Parent  *ZoteroCollection    `json:"parent,omitempty"`
}

func (*ZoteroCollection) GetParents

func (zc *ZoteroCollection) GetParents() []string

type ZoteroCollectionData

type ZoteroCollectionData struct {
	Key              string       `json:"Key"`
	Name             string       `json:"Name"`
	Version          int64        `json:"version"`
	Relations        RelationList `json:"relations"`
	ParentCollection Parent       `json:"parentCollection,omitempty"`
}

type ZoteroCollectionMeta

type ZoteroCollectionMeta struct {
	NumCollections int64 `json:"numCollections"`
	NumItems       int64 `json:"numItems"`
}

type ZoteroData

type ZoteroData struct {
	Key         string             `json:"Key"`
	Version     int                `json:"version"`
	Library     ZoteroLibrary      `json:"library"`
	Links       interface{}        `json:"links"`
	Meta        interface{}        `json:"meta"`
	Data        ItemGeneric        `json:"data"`
	Group       ZoteroGroup        `json:"group"`
	Children    []ZoteroData       `json:"children,omitempty"`
	Collections []ZoteroCollection `json:"collections,omitempty"`
}

type ZoteroGroup

type ZoteroGroup struct {
	Id      int64           `json:"id"`
	Version int64           `json:"version"`
	Links   interface{}     `json:"links,omitempty"`
	Meta    ZoteroGroupMeta `json:"meta"`
	Data    ZoteroGroupData `json:"data"`
}

type ZoteroGroupData

type ZoteroGroupData struct {
	Id             int64   `json:"id"`
	Version        int64   `json:"version"`
	Name           string  `json:"Name"`
	Owner          int64   `json:"owner"`
	Type           string  `json:"type"`
	Description    string  `json:"description"`
	Url            string  `json:"url"`
	HasImage       int64   `json:"hasImage"`
	LibraryEditing string  `json:"libraryEditing"`
	LibraryReading string  `json:"libraryReading"`
	FileEditing    string  `json:"fileEditing"`
	Admins         []int64 `json:"admins"`
}

type ZoteroGroupMeta

type ZoteroGroupMeta struct {
	Created      time.Time `json:"created"`
	LastModified time.Time `json:"lastModified"`
	NumItems     int64     `json:"numItems"`
}

type ZoteroItem

type ZoteroItem struct {
	zotero.Item
	// contains filtered or unexported fields
}

func NewZoteroItem

func NewZoteroItem(zItem zotero.Item, ms mediaserver.Mediaserver) *ZoteroItem

func (*ZoteroItem) GetACL

func (item *ZoteroItem) GetACL() map[string][]string

func (*ZoteroItem) GetAbstract

func (item *ZoteroItem) GetAbstract() *translate.MultiLangString

func (*ZoteroItem) GetCatalogs

func (item *ZoteroItem) GetCatalogs() []string

func (*ZoteroItem) GetCategories

func (item *ZoteroItem) GetCategories() []string

func (*ZoteroItem) GetChildrenLocal

func (item *ZoteroItem) GetChildrenLocal() (*[]ZoteroItem, error)

func (*ZoteroItem) GetCollectionTitle

func (item *ZoteroItem) GetCollectionTitle() string

func (*ZoteroItem) GetContentMime

func (item *ZoteroItem) GetContentMime() string

func (*ZoteroItem) GetContentString

func (item *ZoteroItem) GetContentString() string

func (*ZoteroItem) GetContentType

func (item *ZoteroItem) GetContentType() string

func (*ZoteroItem) GetDate

func (item *ZoteroItem) GetDate() string

func (*ZoteroItem) GetDateAdded

func (item *ZoteroItem) GetDateAdded() time.Time

func (*ZoteroItem) GetExtra

func (item *ZoteroItem) GetExtra() *Metalist

func (*ZoteroItem) GetLicense

func (item *ZoteroItem) GetLicense() string

func (*ZoteroItem) GetMedia

func (item *ZoteroItem) GetMedia() map[string]MediaList

func (*ZoteroItem) GetMeta

func (item *ZoteroItem) GetMeta() *Metalist

func (*ZoteroItem) GetNotes

func (item *ZoteroItem) GetNotes() []Note

func (*ZoteroItem) GetPersons

func (item *ZoteroItem) GetPersons() []Person

func (*ZoteroItem) GetPlace

func (item *ZoteroItem) GetPlace() string

func (*ZoteroItem) GetPoster

func (item *ZoteroItem) GetPoster() *Media

func (*ZoteroItem) GetPublisher

func (item *ZoteroItem) GetPublisher() string

func (*ZoteroItem) GetQueries

func (item *ZoteroItem) GetQueries() []Query

func (*ZoteroItem) GetReferences

func (item *ZoteroItem) GetReferences() []Reference

func (*ZoteroItem) GetRights

func (item *ZoteroItem) GetRights() string

func (*ZoteroItem) GetSeries

func (item *ZoteroItem) GetSeries() string

func (*ZoteroItem) GetSignature

func (item *ZoteroItem) GetSignature() string

func (*ZoteroItem) GetSignatureOriginal

func (item *ZoteroItem) GetSignatureOriginal() string

func (*ZoteroItem) GetSolrDoc

func (item *ZoteroItem) GetSolrDoc() *solr.Document

func (*ZoteroItem) GetSource

func (item *ZoteroItem) GetSource() string

func (*ZoteroItem) GetTags

func (item *ZoteroItem) GetTags() []string

func (*ZoteroItem) GetTitle

func (item *ZoteroItem) GetTitle() *translate.MultiLangString

func (*ZoteroItem) GetUrl

func (item *ZoteroItem) GetUrl() string

func (*ZoteroItem) GetVars

func (item *ZoteroItem) GetVars() *Varlist

func (*ZoteroItem) Name

func (item *ZoteroItem) Name() string

type ZoteroLibrary

type ZoteroLibrary struct {
	Type  string      `json:"type"`
	Id    int64       `json:"id"`
	Name  string      `json:"Name"`
	Links interface{} `json:"links"`
}

type ZoteroStringList

type ZoteroStringList []string

zotero returns single item lists as string

func (*ZoteroStringList) UnmarshalJSON

func (irl *ZoteroStringList) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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