Documentation ¶
Index ¶
- Variables
- func ARKBeautifier(ark string) string
- func ArkParts(pid string) (naan, qualifier, component, variant, inflection string, err error)
- func UniqString(arr []string) []string
- type ARKConfig
- type ARKService
- func (srv *ARKService) AddPlugin(repository string, plugin Plugin)
- func (srv *ARKService) CreatePID(fair *Fair, item *ItemData) (string, error)
- func (srv *ARKService) Resolve(pid string) (string, ResolveResultType, error)
- func (srv *ARKService) Type() dataciteModel.RelatedIdentifierType
- func (srv *ARKService) Unify(ark string) (string, error)
- type Archive
- type ArchiveItem
- type ArkPluginResultType
- type DataAccess
- type DataStatus
- type DataciteConfig
- type DataciteService
- type Fair
- func (f *Fair) AbortUpdate(p *Partition, source string) error
- func (f *Fair) AddArchive(part *Partition, name, description string) error
- func (f *Fair) AddArchiveItem(part *Partition, archive string, item *ItemData) error
- func (f *Fair) AddPartition(p *Partition)
- func (f *Fair) CreateItem(partition *Partition, data *ItemData) (*ItemData, error)
- func (f *Fair) DeleteItem(partition *Partition, uuidStr string) error
- func (f *Fair) EndUpdate(p *Partition, source string) error
- func (f *Fair) GetArchive(part *Partition, name string) (*Archive, error)
- func (f *Fair) GetArchiveItems(part *Partition, archive string, delta bool, fn func(item *ArchiveItem) error) error
- func (f *Fair) GetDB() *pgxpool.Pool
- func (f *Fair) GetItem(partition *Partition, uuidStr string) (*ItemData, error)
- func (f *Fair) GetItemSource(partition *Partition, sourceid int64, signature string) (*ItemData, error)
- func (f *Fair) GetItemsDatestamp(partition *Partition, datestamp, until time.Time, set string, ...) error
- func (f *Fair) GetItemsSeq(partition *Partition, seq int64, until time.Time, access []DataAccess, ...) error
- func (f *Fair) GetMinimumDatestamp(partition *Partition) (time.Time, error)
- func (f *Fair) GetOriginalData(p *Partition, uuid string) ([]byte, string, error)
- func (f *Fair) GetPartition(name string) (*Partition, error)
- func (f *Fair) GetPartitions() map[string]*Partition
- func (f *Fair) GetSets(p *Partition) (map[string]string, error)
- func (f *Fair) GetSourceById(partition *Partition, id int64) (*Source, error)
- func (f *Fair) GetSourceByName(pName string, name string) (*Source, error)
- func (f *Fair) GetSourceByOAIDomain(name string) (*Source, error)
- func (f *Fair) LoadSources() error
- func (f *Fair) NextCounter(name string) (int64, error)
- func (f *Fair) RefreshSearch() error
- func (f *Fair) Resolve(pid string) (data string, resultType ResolveResultType, err error)
- func (f *Fair) Search(p *Partition, dtr *datatable.Request) ([]map[string]string, int64, int64, error)
- func (f *Fair) SetOriginalData(p *Partition, uuid string, format string, data []byte) error
- func (f *Fair) SetSource(src *Source) error
- func (f *Fair) StartUpdate(p *Partition, source string) error
- type HandleConfig
- type HandleService
- type ItemData
- type MultiResolver
- func (mr *MultiResolver) AddResolver(resolver Resolver)
- func (mr *MultiResolver) CreateAll(part *Partition, t dataciteModel.RelatedIdentifierType) error
- func (mr *MultiResolver) CreatePID(uuid string, part *Partition, ...) (string, error)
- func (mr *MultiResolver) GetPartition() *Partition
- func (mr *MultiResolver) InitPIDTable() error
- func (mr *MultiResolver) Resolve(pid string) (data string, resultType ResolveResultType, err error)
- func (mr *MultiResolver) StorePID(uuid string, identifierType dataciteModel.RelatedIdentifierType, ...) error
- type OAIConfig
- type Partition
- func (p *Partition) AddResolver(mr *MultiResolver)
- func (p *Partition) CreatePID(uuid string, identifierType dataciteModel.RelatedIdentifierType) (string, error)
- func (p *Partition) GetFair() *Fair
- func (p *Partition) GetMultiResolver() *MultiResolver
- func (p *Partition) RedirURL(uuid string) string
- func (p *Partition) Resolve(pid string) (string, ResolveResultType, error)
- type Plugin
- type PluginResult
- type ResolveResultType
- type Resolver
- type ResolverResolve
- type Source
- type SourceData
Constants ¶
This section is empty.
Variables ¶
View Source
var DataAccessReverse = map[string]DataAccess{ string(DataAccessPublic): DataAccessPublic, string(DataAccessClosed): DataAccessClosed, string(DataAccessClosedData): DataAccessClosedData, string(DataAccessOpenAccess): DataAccessOpenAccess, }
View Source
var DataStatusReverse = map[string]DataStatus{ string(DataStatusActive): DataStatusActive, string(DataStatusDisabled): DataStatusDisabled, string(DataStatusDeleted): DataStatusDeleted, string(DataStatusDeletedMeta): DataStatusDeletedMeta, }
View Source
var ErrInvalidIdentifier = errors.New("invalid identifier")
Functions ¶
func ARKBeautifier ¶ added in v2.0.13
func UniqString ¶ added in v2.0.6
Types ¶
type ARKService ¶ added in v2.0.10
type ARKService struct {
// contains filtered or unexported fields
}
func NewARKService ¶ added in v2.0.10
func NewARKService(mr *MultiResolver, config *ARKConfig, logger zLogger.ZLogger) (*ARKService, error)
func (*ARKService) AddPlugin ¶ added in v2.0.10
func (srv *ARKService) AddPlugin(repository string, plugin Plugin)
func (*ARKService) CreatePID ¶ added in v2.0.10
func (srv *ARKService) CreatePID(fair *Fair, item *ItemData) (string, error)
func (*ARKService) Resolve ¶ added in v2.0.10
func (srv *ARKService) Resolve(pid string) (string, ResolveResultType, error)
func (*ARKService) Type ¶ added in v2.0.10
func (srv *ARKService) Type() dataciteModel.RelatedIdentifierType
type ArchiveItem ¶ added in v2.0.6
type ArkPluginResultType ¶ added in v2.0.10
type ArkPluginResultType uint
const ( ARKPluginCannotHandle ArkPluginResultType = iota ARKPluginData ARKPluginRedirect )
type DataAccess ¶
type DataAccess string
const ( DataAccessPublic DataAccess = "public" DataAccessClosed DataAccess = "closed" DataAccessClosedData DataAccess = "closed_data" DataAccessOpenAccess DataAccess = "open_access" )
type DataStatus ¶
type DataStatus string
const ( DataStatusActive DataStatus = "active" DataStatusDisabled DataStatus = "disabled" DataStatusDeleted DataStatus = "deleted" DataStatusDeletedMeta DataStatus = "deleted_meta" )
type DataciteConfig ¶ added in v2.0.10
type DataciteService ¶ added in v2.0.10
type DataciteService struct {
// contains filtered or unexported fields
}
func NewDataciteService ¶ added in v2.0.10
func NewDataciteService(mr *MultiResolver, config DataciteConfig, logger zLogger.ZLogger) (*DataciteService, error)
func (*DataciteService) CreatePID ¶ added in v2.0.10
func (srv *DataciteService) CreatePID(fair *Fair, item *ItemData) (string, error)
func (*DataciteService) Resolve ¶ added in v2.0.10
func (srv *DataciteService) Resolve(pid string) (string, ResolveResultType, error)
func (*DataciteService) Type ¶ added in v2.0.10
func (srv *DataciteService) Type() dataciteModel.RelatedIdentifierType
type Fair ¶
type Fair struct {
// contains filtered or unexported fields
}
func (*Fair) AddArchive ¶ added in v2.0.6
func (*Fair) AddArchiveItem ¶ added in v2.0.6
func (*Fair) AddPartition ¶
func (*Fair) CreateItem ¶
func (*Fair) GetArchive ¶ added in v2.0.7
func (*Fair) GetArchiveItems ¶ added in v2.0.6
func (*Fair) GetItemSource ¶
func (*Fair) GetItemsDatestamp ¶
func (*Fair) GetItemsSeq ¶
func (*Fair) GetMinimumDatestamp ¶
func (*Fair) GetOriginalData ¶ added in v2.0.4
func (*Fair) GetPartitions ¶
func (*Fair) GetSourceById ¶
func (*Fair) GetSourceByName ¶
func (*Fair) GetSourceByOAIDomain ¶
func (*Fair) LoadSources ¶
func (*Fair) RefreshSearch ¶
func (*Fair) Resolve ¶ added in v2.0.10
func (f *Fair) Resolve(pid string) (data string, resultType ResolveResultType, err error)
func (*Fair) SetOriginalData ¶ added in v2.0.4
type HandleConfig ¶ added in v2.0.10
type HandleService ¶ added in v2.0.10
type HandleService struct {
// contains filtered or unexported fields
}
func NewHandleService ¶ added in v2.0.10
func NewHandleService(mr *MultiResolver, config *HandleConfig, logger zLogger.ZLogger) (*HandleService, error)
func (*HandleService) CreatePID ¶ added in v2.0.10
func (srv *HandleService) CreatePID(fair *Fair, item *ItemData) (string, error)
func (*HandleService) Resolve ¶ added in v2.0.10
func (srv *HandleService) Resolve(pid string) (string, ResolveResultType, error)
func (*HandleService) Type ¶ added in v2.0.10
func (srv *HandleService) Type() dataciteModel.RelatedIdentifierType
type ItemData ¶
type ItemData struct { Source string `json:"source"` Partition string `json:"partition"` Signature string `json:"signature"` Metadata myfair.Core `json:"metadata"` Set []string `json:"set"` Catalog []string `json:"catalog"` Identifier []string `json:"identifier"` Access DataAccess `json:"access"` Status DataStatus `json:"status"` Seq int64 `json:"-"` UUID string `json:"uuid"` Datestamp time.Time `json:"datestamp"` URL string }
type MultiResolver ¶ added in v2.0.10
type MultiResolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶ added in v2.0.10
func NewResolver(part *Partition, logger zLogger.ZLogger) (*MultiResolver, error)
func (*MultiResolver) AddResolver ¶ added in v2.0.10
func (mr *MultiResolver) AddResolver(resolver Resolver)
func (*MultiResolver) CreateAll ¶ added in v2.0.10
func (mr *MultiResolver) CreateAll(part *Partition, t dataciteModel.RelatedIdentifierType) error
func (*MultiResolver) CreatePID ¶ added in v2.0.10
func (mr *MultiResolver) CreatePID(uuid string, part *Partition, identifierType dataciteModel.RelatedIdentifierType) (string, error)
func (*MultiResolver) GetPartition ¶ added in v2.0.10
func (mr *MultiResolver) GetPartition() *Partition
func (*MultiResolver) InitPIDTable ¶ added in v2.0.10
func (mr *MultiResolver) InitPIDTable() error
func (*MultiResolver) Resolve ¶ added in v2.0.10
func (mr *MultiResolver) Resolve(pid string) (data string, resultType ResolveResultType, err error)
func (*MultiResolver) StorePID ¶ added in v2.0.10
func (mr *MultiResolver) StorePID(uuid string, identifierType dataciteModel.RelatedIdentifierType, identifier string) error
type Partition ¶
type Partition struct { Name string AddrExt string Description string JWTKey string JWTAlg []string Domain string HandlePrefix string OAI *OAIConfig // contains filtered or unexported fields }
func NewPartition ¶
func (*Partition) AddResolver ¶ added in v2.0.10
func (p *Partition) AddResolver(mr *MultiResolver)
func (*Partition) CreatePID ¶ added in v2.0.10
func (p *Partition) CreatePID(uuid string, identifierType dataciteModel.RelatedIdentifierType) (string, error)
func (*Partition) GetMultiResolver ¶ added in v2.0.10
func (p *Partition) GetMultiResolver() *MultiResolver
type Plugin ¶ added in v2.0.10
type Plugin interface {
Handle(fair *Fair, pid string, item *ItemData) (*PluginResult, error)
}
type PluginResult ¶ added in v2.0.10
type PluginResult struct { Type ArkPluginResultType Data []byte Mime string }
type ResolveResultType ¶ added in v2.0.10
type ResolveResultType uint32
const ( ResolveResultTypeUnknown ResolveResultType = iota ResolveResultTypeRedirect ResolveResultTypeTextHTML ResolveResultTypeTextPlain ResolveResultTypeApplicationJSON ResolveResultTypeApplicationYAML ResolveResultTypeApplicationXML )
type Resolver ¶ added in v2.0.10
type Resolver interface { ResolverResolve Type() dataciteModel.RelatedIdentifierType //Unify(ark string) (string, error) CreatePID(fair *Fair, item *ItemData) (string, error) }
type ResolverResolve ¶ added in v2.0.10
type ResolverResolve interface {
Resolve(pid string) (string, ResolveResultType, error)
}
type SourceData ¶
type SourceData struct {
Source string `json:"source"`
}
Click to show internal directories.
Click to hide internal directories.