Documentation ¶
Index ¶
- Constants
- Variables
- func AboutShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func AddRoutes() http.Handler
- func AnnotationCounts(uuid string) int
- func AnnototCreate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func AnnototListAll(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func AnnototPages(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func AnnototUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ApplyPrefixes(s string) string
- func BackgroundHarvester()
- func CheckPassword(username, pass string) error
- func ClearUserFromCache(username string)
- func ConfigPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func CreateResetToken(username string) (string, error)
- func DoTemplate(w io.Writer, name string, data interface{})
- func DownloadFileToCache(base string, url string) error
- func FindFileInCache(base string) string
- func GetObject(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func HarvestCurateObjects(remote *RemoteFedora, since time.Time, f func(CurateItem) error) error
- func IndexEverything(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func IndexHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func LoadTemplates(path string) error
- func NewIdentifier() string
- func NotImplemented(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectAnnotate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectDownload(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectDownloadThumbnail(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectEdit(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectIndex(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectNewPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ObjectShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ParseNotWellformedTime(input string) time.Time
- func PrintItem(item CurateItem) error
- func ProfileEditShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ProfileEditUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ProfileNewPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ProfileNewShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ProfileShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ProfileUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ReadBendoItem(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadCharacterization(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadContent(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadDescMetadata(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadProperties(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadRelsExt(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadRightsMetadata(remote *RemoteFedora, id string, result *CurateItem) error
- func ReadThumbnail(remote *RemoteFedora, id string, result *CurateItem) error
- func ResetPassword(username string, newpass string) error
- func ResetShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ResetUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func SaveUser(user *User) error
- func SearchPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ShowAnnotateStatus(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ShowForbidden(w http.ResponseWriter)
- func StartBackgroundProcess()
- func UpdateConfig(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func VerifyAuth(w http.ResponseWriter, r *http.Request, ps httprouter.Params) bool
- type Access
- type AllItems
- type AnnoStore
- func (as *AnnoStore) AnnotationListByUUID(uuid string) (QueryAnnotationList, error)
- func (as *AnnoStore) BackgroundRAPchecker(c <-chan struct{})
- func (as *AnnoStore) RAPStatus() ([]RAPs, error)
- func (as *AnnoStore) UploadItem(item CurateItem, uploader *User) (string, error)
- func (as *AnnoStore) ViewerURL(uuid string) string
- type Batcher
- type CurateItem
- type CurateItemAlt
- type DSList
- type DsInfo
- type ElasticSearcher
- type Fedora
- type Grouper
- type Hit
- type ItemAnnotationInfo
- type ItemUUID
- type LimitedToken
- type MysqlDB
- func (sq *MysqlDB) FindAllRange(offset, count int) ([]CurateItem, error)
- func (sq *MysqlDB) FindCollectionMembers(pid string) ([]CurateItem, error)
- func (sq *MysqlDB) FindItem(pid string) (CurateItem, error)
- func (sq *MysqlDB) FindItemFiles(pid string) ([]CurateItem, error)
- func (sq *MysqlDB) FindUser(username string) (*User, error)
- func (sq *MysqlDB) FindUserByToken(token string) (*User, error)
- func (sq *MysqlDB) IndexBatch(source Batcher)
- func (sq *MysqlDB) IndexItem(item CurateItem) error
- func (sq *MysqlDB) IndexRecord(item CurateItem)
- func (sq *MysqlDB) ReadConfig(key string) (string, error)
- func (sq *MysqlDB) RecordEvent(event string, user *User, other string)
- func (sq *MysqlDB) SaveUser(user *User) error
- func (sq *MysqlDB) Search(q SearchQuery) (SearchResults, error)
- func (sq *MysqlDB) SearchItemUUID(item string, username string, status string) ([]ItemUUID, error)
- func (sq *MysqlDB) SetConfig(key string, value string) error
- func (sq *MysqlDB) TotCreate(tot tots) error
- func (sq *MysqlDB) TotUpdateData(tot tots) error
- func (sq *MysqlDB) TotsByCanvas(canvas string) ([]tots, error)
- func (sq *MysqlDB) UpdateUUID(record ItemUUID) error
- type NewUserData
- type ObjectInfo
- type Pair
- type PredicatePair
- type QueryAnnotationList
- type RAPInfo
- type RAPs
- type RelsExtDS
- type RemoteFedora
- func (rf *RemoteFedora) GetDatastream(id, dsname string) (io.ReadCloser, error)
- func (rf *RemoteFedora) GetDatastreamInfo(id, dsname string) (DsInfo, error)
- func (rf *RemoteFedora) GetDatastreamList(id string) ([]string, error)
- func (rf *RemoteFedora) GetObjectInfo(id string) (ObjectInfo, error)
- func (rf *RemoteFedora) MakeDatastream(id string, info DsInfo, content io.Reader) error
- func (rf *RemoteFedora) MakeObject(info ObjectInfo) error
- func (rf *RemoteFedora) SearchObjects(query string, token string) ([]string, string, error)
- func (rf *RemoteFedora) UpdateDatastream(id string, info DsInfo, content io.Reader) error
- type SearchQuery
- type SearchResults
- type Searcher
- type SolrInfo
- type SolrQuery
- type SolrResponse
- type Store
- type StringOrList
- type SubmitRA
- type SubmitRAP
- type TestFedora
- type Thumbnail
- type User
Constants ¶
const ( HNow = iota HExit StatusWaiting = iota StatusHarvesting )
Variables ¶
var ( FileCacheRoot string TimeoutClient *http.Client ErrDownload = errors.New("Error copying data from Curate") )
var ( ErrNotFound = errors.New("Item Not Found in Fedora") ErrNotAuthorized = errors.New("Access Denied") ErrNeedPID = errors.New("PID missing") )
Exported errors
var ( Templates *template.Template Datasource *MysqlDB TargetFedora *RemoteFedora StaticFilePath string CurateURL string )
var (
AnnoChan chan struct{}
)
var (
ErrNoContent = errors.New("No content")
)
var (
ErrPasswordMismatch = errors.New("Password does not match")
)
var Prefixes = map[string]string{
"info:fedora/und:": "und:",
"info:fedora/afmodel:": "",
"http://purl.org/dc/terms/": "dc:",
"https://library.nd.edu/ns/terms/": "nd:",
"http://purl.org/ontology/bibo/": "bibo:",
"http://www.ndltd.org/standards/metadata/etdms/1.1/": "ms:",
"http://purl.org/vra/": "vracore:",
"http://id.loc.gov/vocabulary/relators/": "mrel:",
"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#": "ebucore:",
"http://xmlns.com/foaf/0.1/": "foaf:",
"http://projecthydra.org/ns/relations#": "hydra:",
"http://www.w3.org/2000/01/rdf-schema#": "rdfs:",
"http://purl.org/pav/": "pav:",
}
Functions ¶
func AboutShow ¶
func AboutShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func AnnotationCounts ¶
AnnotationCounts will return the number of annotations on item uuid.
func AnnototCreate ¶
func AnnototCreate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
AnnototCreate creates a new annotation.
POST /annotot body of request is the annotation in JSON
func AnnototListAll ¶
func AnnototListAll(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
AnnototList displays all the tots in the database
GET /annotot This returns HTML
func AnnototPages ¶
func AnnototPages(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
AnnototPages returns a list of annotations for a given object.
GET /annotot/pages
The object is passed in with the `uri=` parameter. The result list contains the contents for all the annotations on that object.
func AnnototUpdate ¶
func AnnototUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
AnnototUpdate updates a given annotation
PATCH /annotot/:uuid the body is an annotation as JSON, just as with AnnototCreate
func ApplyPrefixes ¶
func BackgroundHarvester ¶
func BackgroundHarvester()
func CheckPassword ¶
CheckPassword takes the given user name and password, compares it against what is in the database and returns either nil, for a match, the error ErrPasswordMismatch if the username/password don't match.
func ClearUserFromCache ¶
func ClearUserFromCache(username string)
func ConfigPage ¶
func ConfigPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func CreateResetToken ¶
func DoTemplate ¶
func DownloadFileToCache ¶
func FindFileInCache ¶
FindFileInCache will see if the given base name is in the cache. It it is, an absolute path to the file is returned. Otherwise an empty string is returned.
func GetObject ¶
func GetObject(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func HarvestCurateObjects ¶
func HarvestCurateObjects(remote *RemoteFedora, since time.Time, f func(CurateItem) error) error
func IndexEverything ¶
func IndexEverything(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func IndexHandler ¶
func IndexHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
IndexHandler responds to the root route.
func LoadTemplates ¶
LoadTemplates will load and compile our templates into memory
func NewIdentifier ¶
func NewIdentifier() string
NewIdentifier returns a unique string suitable for use in URLs and filenames. This implementation uses randomness, so there is a small possibility of duplicate identifiers being generated.
func NotImplemented ¶
func NotImplemented(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectAnnotate ¶
func ObjectAnnotate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectDownload ¶
func ObjectDownload(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectDownloadThumbnail ¶
func ObjectDownloadThumbnail(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectEdit ¶
func ObjectEdit(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectIndex ¶
func ObjectIndex(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectNew ¶
func ObjectNew(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectNewPost ¶
func ObjectNewPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ObjectShow ¶
func ObjectShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ParseNotWellformedTime ¶
func PrintItem ¶
func PrintItem(item CurateItem) error
func ProfileEditShow ¶
func ProfileEditShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ProfileEditUpdate ¶
func ProfileEditUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ProfileNewPost ¶
func ProfileNewPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ProfileNewShow ¶
func ProfileNewShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ProfileShow ¶
func ProfileShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ProfileUpdate ¶
func ProfileUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ReadBendoItem ¶
func ReadBendoItem(remote *RemoteFedora, id string, result *CurateItem) error
func ReadCharacterization ¶
func ReadCharacterization(remote *RemoteFedora, id string, result *CurateItem) error
func ReadContent ¶
func ReadContent(remote *RemoteFedora, id string, result *CurateItem) error
func ReadDescMetadata ¶
func ReadDescMetadata(remote *RemoteFedora, id string, result *CurateItem) error
func ReadProperties ¶
func ReadProperties(remote *RemoteFedora, id string, result *CurateItem) error
func ReadRelsExt ¶
func ReadRelsExt(remote *RemoteFedora, id string, result *CurateItem) error
func ReadRightsMetadata ¶
func ReadRightsMetadata(remote *RemoteFedora, id string, result *CurateItem) error
func ReadThumbnail ¶
func ReadThumbnail(remote *RemoteFedora, id string, result *CurateItem) error
func ResetPassword ¶
func ResetShow ¶
func ResetShow(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ResetUpdate ¶
func ResetUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func SaveUser ¶
SaveUser saves the given user record to the database, possibly updating an existing record. User records are identified by their ID number.
func SearchPage ¶
func SearchPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ShowAnnotateStatus ¶
func ShowAnnotateStatus(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ShowForbidden ¶
func ShowForbidden(w http.ResponseWriter)
func StartBackgroundProcess ¶
func StartBackgroundProcess()
func UpdateConfig ¶
func UpdateConfig(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func VerifyAuth ¶
func VerifyAuth(w http.ResponseWriter, r *http.Request, ps httprouter.Params) bool
VerifyAuth looks at the basic auth username and password. If it is not valid, it returns a response asking for better ones and returns false. If it is valid, it returns true.
Types ¶
type AllItems ¶
AllItems is a Batcher that will return everything in the database. It returns Count items at a time, which if equalt to 0 defaults to 500 items.
func (*AllItems) Batch ¶
func (a *AllItems) Batch() []CurateItem
type AnnoStore ¶
func (*AnnoStore) AnnotationListByUUID ¶
func (as *AnnoStore) AnnotationListByUUID(uuid string) (QueryAnnotationList, error)
func (*AnnoStore) BackgroundRAPchecker ¶
func (as *AnnoStore) BackgroundRAPchecker(c <-chan struct{})
backgroundRAPchecker will poll the annotation server to track the statuses of RAP ingests. It adjusts its polling interval depending on whether there are any pending jobs. Send something on the channel c to notify the poller that there is a new pending job to monitor.
func (*AnnoStore) UploadItem ¶
func (as *AnnoStore) UploadItem(item CurateItem, uploader *User) (string, error)
type Batcher ¶
type Batcher interface {
Batch() []CurateItem
}
A Batcher provides a way to iterate through a (potentially very large) set of CurateItems. Each time Batch() is called another subset of the set should be returned. The empty list is returned when there is nothing left and signals that the iteration is finished.
type CurateItem ¶
A CurateItem holds the metadata record for a single collection, item, or file. It consists of our local identifier for the item (with the namespace prefix, if any), and then a sequence of field-value pairs. The field names can repeat. The ordering of the pairs is only important among those having the same field name.
func AttachedFiles ¶
func AttachedFiles(pid string) []CurateItem
func CollectionMembers ¶
func CollectionMembers(pid string) []CurateItem
func FetchOneCurateObject ¶
func FetchOneCurateObject(remote *RemoteFedora, id string) (CurateItem, error)
FetchOneCurateObject loads the given fedora object and interpretes it as if it were a curate object. This means only certain datastreams are downloaded.
func (*CurateItem) Add ¶
func (c *CurateItem) Add(predicate string, value string)
func (*CurateItem) AsAlternate ¶
func (c *CurateItem) AsAlternate() CurateItemAlt
func (*CurateItem) FirstField ¶
func (c *CurateItem) FirstField(targets ...string) string
func (*CurateItem) RemoveAll ¶
func (c *CurateItem) RemoveAll(target string)
type CurateItemAlt ¶
A CurateItemAlt is an alternative representation of a CurateItem. It consolidates each property field name into a map entry, and arranges the (possibly multiple) values as a list. The PID is stored under the map entry "PID".
type DSList ¶
type DSList struct { DS []struct { Name string `xml:"dsid,attr"` } `xml:"datastream"` }
type DsInfo ¶
type DsInfo struct { Name string `xml:"dsID,attr"` Label string `xml:"dsLabel"` VersionID string `xml:"dsVersionID"` State string `xml:"dsState"` Checksum string `xml:"dsChecksum"` ChecksumType string `xml:"dsChecksumType"` MIMEType string `xml:"dsMIME"` Location string `xml:"dsLocation"` LocationType string `xml:"dsLocationType"` ControlGroup string `xml:"dsControlGroup"` Versionable bool `xml:"dsVersionable"` Size int `xml:"dsSize"` }
DsInfo holds more complete metadata on a datastream (as opposed to the ContentInfo structure)
type ElasticSearcher ¶
type ElasticSearcher struct {
Client *elasticsearch.Client
}
func (*ElasticSearcher) IndexBatch ¶
func (e *ElasticSearcher) IndexBatch(source Batcher)
IndexBatch will index a lot of records. It is expected to be more effecient than calling IndexRecord on each record.
func (*ElasticSearcher) IndexRecord ¶
func (e *ElasticSearcher) IndexRecord(item CurateItem)
func (*ElasticSearcher) Search ¶
func (e *ElasticSearcher) Search(q SearchQuery) (SearchResults, error)
type Fedora ¶
type Fedora interface { // Return the contents of the dsname datastream of object id. // You are expected to close it when you are finished. //GetDatastream(id, dsname string) (io.ReadCloser, ContentInfo, error) // GetDatastreamInfo returns the metadata Fedora stores about the named // datastream. GetDatastreamInfo(id, dsname string) (DsInfo, error) SearchObjects(query string, token string) ([]string, string, error) }
Fedora represents a Fedora Commons server. The exact nature of the server is unspecified.
type Grouper ¶
A Grouper wraps a source Batcher and always returns lists containing Goal number of items, except for the last one which may have less.
func (*Grouper) Batch ¶
func (g *Grouper) Batch() []CurateItem
type ItemAnnotationInfo ¶
type ItemAnnotationInfo struct { // the item these annotations are for PID string // The Primary RAP is the one this user has uploaded. It's UUID is "" if // this user has not copied the item to the annotation service. Primary RAPInfo // the other RAPs are ones other users have uploaded Others []RAPInfo }
func GetAnnotationInfoForItem ¶
func GetAnnotationInfoForItem(pid string, username string) ItemAnnotationInfo
type LimitedToken ¶
type LimitedToken struct { Token string Creator string Created time.Time Item string Expire time.Time Used bool }
func CreateLimitedToken ¶
func CreateLimitedToken(item string, user string) *LimitedToken
type MysqlDB ¶
type MysqlDB struct {
// contains filtered or unexported fields
}
store pointer to sql database
func NewMySQL ¶
NewMySQL returns a Repository backed by a MySQL database, as determined by the connection string. An error is returned if any problems are run into.
func (*MysqlDB) FindAllRange ¶
func (sq *MysqlDB) FindAllRange(offset, count int) ([]CurateItem, error)
FindAllRange returns a list of every purl in the database.
func (*MysqlDB) FindCollectionMembers ¶
func (sq *MysqlDB) FindCollectionMembers(pid string) ([]CurateItem, error)
func (*MysqlDB) FindItem ¶
func (sq *MysqlDB) FindItem(pid string) (CurateItem, error)
FindItem returns a single CurateItem record identified by PID.
func (*MysqlDB) FindItemFiles ¶
func (sq *MysqlDB) FindItemFiles(pid string) ([]CurateItem, error)
func (*MysqlDB) IndexBatch ¶
func (*MysqlDB) IndexItem ¶
func (sq *MysqlDB) IndexItem(item CurateItem) error
func (*MysqlDB) IndexRecord ¶
func (sq *MysqlDB) IndexRecord(item CurateItem)
func (*MysqlDB) RecordEvent ¶
func (*MysqlDB) Search ¶
func (sq *MysqlDB) Search(q SearchQuery) (SearchResults, error)
func (*MysqlDB) SearchItemUUID ¶
func (*MysqlDB) TotUpdateData ¶
update the annotation given by tot.UUID to have tot.Data
func (*MysqlDB) TotsByCanvas ¶
func (*MysqlDB) UpdateUUID ¶
type NewUserData ¶
type ObjectInfo ¶
type PredicatePair ¶
type QueryAnnotationList ¶
type QueryAnnotationList struct { Error string `json:"error"` ID string `json:"@id"` Annotations []struct { Type string `json:"@type"` ID string `json:"@id"` AnnoStore struct { RA string `json:"researchActivity"` } `json:"__annostore"` Author struct { ID string `json:"@id"` Name string `json:"name"` } `json:"annotatedBy"` Created time.Time `json:"annotatedAt"` Motivation []string `json:"motivation"` } `json:"resources"` }
type RelsExtDS ¶
type RelsExtDS struct { Description struct { P []PredicatePair `xml:",any"` } `xml:"Description"` }
type RemoteFedora ¶
type RemoteFedora struct {
// contains filtered or unexported fields
}
func NewRemote ¶
func NewRemote(fedoraPath string) *RemoteFedora
NewRemote creates a reference to a remote Fedora repository. fedoraPath is a complete URL including username and password, if necessary. For example
http://fedoraAdmin:password@localhost:8983/fedora/
The returned structure does not buffer or cache Fedora responses.
func (*RemoteFedora) GetDatastream ¶
func (rf *RemoteFedora) GetDatastream(id, dsname string) (io.ReadCloser, error)
returns the contents of the datastream `dsname`. The returned stream needs to be closed when finished.
func (*RemoteFedora) GetDatastreamInfo ¶
func (rf *RemoteFedora) GetDatastreamInfo(id, dsname string) (DsInfo, error)
func (*RemoteFedora) GetDatastreamList ¶
func (rf *RemoteFedora) GetDatastreamList(id string) ([]string, error)
func (*RemoteFedora) GetObjectInfo ¶
func (rf *RemoteFedora) GetObjectInfo(id string) (ObjectInfo, error)
func (*RemoteFedora) MakeDatastream ¶
func (*RemoteFedora) MakeObject ¶
func (rf *RemoteFedora) MakeObject(info ObjectInfo) error
func (*RemoteFedora) SearchObjects ¶
func (*RemoteFedora) UpdateDatastream ¶
type SearchQuery ¶
type SearchResults ¶
type SearchResults struct { Total int Items []CurateItem }
type Searcher ¶
type Searcher interface { Search(q SearchQuery) (SearchResults, error) IndexRecord(item CurateItem) IndexBatch(source Batcher) }
A Searcher represents our interface to an external index service.
var (
SearchEngine Searcher
)
func NewElasticSearch ¶
type SolrInfo ¶
type SolrInfo struct {
Host string
}
var (
Solr *SolrInfo
)
func (*SolrInfo) IndexBatch ¶
func (*SolrInfo) IndexRecord ¶
func (si *SolrInfo) IndexRecord(item CurateItem)
IndexRecord and IndexBatch for Solr is not supported.
func (*SolrInfo) Search ¶
func (si *SolrInfo) Search(q SearchQuery) (SearchResults, error)
type SolrResponse ¶
type SolrResponse struct { Response struct { NumFound int `json:"numFound"` Start int `json:"start"` MaxScore float32 `json:"maxScore"` Docs []map[string]StringOrList `json:"docs"` } `json:"response"` }
type Store ¶
type Store struct {
Root string
}
Store provides a place to save file content. At some point it would be nice for it to provide versioning.
var (
FileStore Store
)
func (*Store) MakeThumbnailImage ¶
func (*Store) MakeThumbnailPDF ¶
type StringOrList ¶
type StringOrList []string
StringOrList is used to decode json documents having values that may either be a string or a list of strings. It makes everything a list of strings, so that we have a consistent data type.
func (*StringOrList) UnmarshalJSON ¶
func (x *StringOrList) UnmarshalJSON(b []byte) error
type SubmitRA ¶
type SubmitRA struct { ID string PID string `json:"pid"` Action string `json:"action"` RepositoryURL string `json:"repository-url"` Title string `json:"title"` Description string `json:"description"` Owners []string `json:"owners"` DateCreated time.Time `json:"date-created"` Creators []string `json:"creators"` AccessView []string `json:"access-view"` AccessEdit []string `json:"access-edit"` Metadata map[string]string `json:"metadata"` }
type SubmitRAP ¶
type SubmitRAP struct { ID string PID string `json:"pid"` Action string `json:"action"` RepositoryURL string `json:"repository-url"` Title string `json:"title"` Description string `json:"description"` Owners []string `json:"owners"` DateCreated time.Time `json:"date-created"` Creators []string `json:"creators"` AccessView []string `json:"access-view"` AccessEdit []string `json:"access-edit"` Metadata map[string]string `json:"metadata"` RA string `json:"ra"` Content []string `json:"content"` ContentChecksums []string `json:"content-checksums"` ContentAccess string `json:"content-access"` Copyright string `json:"copyright"` License string `json:"license"` }
type TestFedora ¶
type TestFedora struct {
// contains filtered or unexported fields
}
TestFedora implements a simple in-memory Fedora stub which will return bytes which have already been specified by Set(). Intended for testing. (Maybe move to a testing file?)
func NewTestFedora ¶
func NewTestFedora() *TestFedora
NewTestFedora creates an empty TestFedora object.
func (*TestFedora) GetDatastreamInfo ¶
func (tf *TestFedora) GetDatastreamInfo(id, dsname string) (DsInfo, error)
GetDatastreamInfo returns Fedora's metadata for the given datastream.
type User ¶
func CreateNewUser ¶
func FindUser ¶
FindUser returns a user record for the given user name. If there is no such user record in the database, nil is returned.
func FindUserByToken ¶
FindUserByToken returns a user record given a password reset token. If there is no such token, nil is returned.