Documentation
¶
Index ¶
- Constants
- Variables
- type CreateTreeFn
- type DaoFn
- type EADHarvester
- type Meta
- type Metrics
- type MetsHarvester
- type Option
- func SetCreateTree(fn CreateTreeFn) Option
- func SetDataDir(path string) Option
- func SetIndexService(is *index.Service) Option
- func SetProcessDigital(isEnabled bool) Option
- func SetProcessDigitalIfMissing(isEnabled bool) Option
- func SetRevisionService(rs *revision.Service) Option
- func SetWorkers(workers int) Option
- type PreStoreFn
- type ProcessingState
- type Service
- func (s *Service) AddPostHook(hook domain.PostHookService) error
- func (s *Service) CancelTask(w http.ResponseWriter, r *http.Request)
- func (s *Service) ClearRestrictions(w http.ResponseWriter, r *http.Request)
- func (s *Service) CreateTask(r *http.Request, meta Meta) (*taskResponse, error)
- func (s *Service) DeleteEAD(datasetID, orgID string) error
- func (s *Service) GetName(b []byte) (string, error)
- func (s *Service) GetTask(w http.ResponseWriter, r *http.Request)
- func (s *Service) LoadEAD(orgID, spec string) (Meta, error)
- func (s *Service) LoadModifiedEADDate(spec string) time.Time
- func (s *Service) Metrics() Metrics
- func (s *Service) NewTask(meta *Meta) (*Task, error)
- func (s *Service) Process(parentCtx context.Context, t *Task) error
- func (s *Service) ResyncCacheDir(orgID string) error
- func (s *Service) Routes(router chi.Router)
- func (s *Service) SaveEAD(r io.Reader, size int64, datasetID, orgID string) (Meta, error)
- func (s *Service) SaveModifiedEADDate(spec string, modified string) error
- func (s *Service) Shutdown(ctx context.Context) error
- func (s *Service) StartWorkers() error
- func (s *Service) Tasks(w http.ResponseWriter, r *http.Request)
- func (s *Service) Upload(w http.ResponseWriter, r *http.Request)
- type Task
- type Transition
Constants ¶
View Source
const ( StateSubmitted ProcessingState = "submitted source EAD" StatePending = "pending processing" StateStarted = "started processing" StateProcessingDescription = "processing description" StateProcessingMetsFiles = "processing METS files" StateProcessingInventories = "processing and indexing inventories" StateInError = "stopped processing with error" StateCanceled = "canceled processing" StateFinished = "finished processing EAD" StateDeleted = "deleted EAD" )
View Source
const (
PaccessKey = "processAccessTime"
)
Variables ¶
View Source
var ( ErrTaskNotFound = errors.New("task not found") ErrTaskAlreadySubmitted = errors.New("task already submitted") )
Functions ¶
This section is empty.
Types ¶
type CreateTreeFn ¶
type EADHarvester ¶ added in v0.2.0
type EADHarvester struct { OrgID string // contains filtered or unexported fields }
func NewEADHarvester ¶ added in v0.2.0
func NewEADHarvester(s *Service) (EADHarvester, error)
func (*EADHarvester) ProcessEadFromOai ¶ added in v0.2.0
func (e *EADHarvester) ProcessEadFromOai(r *oai.Response)
type Meta ¶
type Meta struct { OrgID string DatasetID string Title string Clevels uint64 DaoLinks uint64 DaoErrors uint64 DaoErrorLinks map[string]string Tags []string TotalRecordsPublished uint64 DigitalObjects uint64 FileSize uint64 Revision int32 ProcessDigital bool ProcessDigitalIfMissing bool ProcessAccessTime time.Time Created bool ProcessingDuration time.Duration `json:"processingDuration,omitempty"` ProcessingDurationFmt string `json:"processingDurationFmt,omitempty"` // contains filtered or unexported fields }
type Metrics ¶
type Metrics struct { Submitted uint64 Started uint64 Failed uint64 Finished uint64 Canceled uint64 AlreadyQueued uint64 }
func (*Metrics) IncAlreadyQueued ¶ added in v0.2.0
func (m *Metrics) IncAlreadyQueued()
func (*Metrics) IncCancelled ¶ added in v0.2.0
func (m *Metrics) IncCancelled()
func (*Metrics) IncFinished ¶ added in v0.2.0
func (m *Metrics) IncFinished()
func (*Metrics) IncStarted ¶ added in v0.2.0
func (m *Metrics) IncStarted()
func (*Metrics) IncSubmitted ¶ added in v0.2.0
func (m *Metrics) IncSubmitted()
type MetsHarvester ¶ added in v0.2.0
type MetsHarvester struct { OrgID string // contains filtered or unexported fields }
func NewMetsHarvest ¶ added in v0.2.0
func NewMetsHarvest(c *ead.DaoClient) (MetsHarvester, error)
func (*MetsHarvester) ProcessMetsFromOai ¶ added in v0.2.0
func (m *MetsHarvester) ProcessMetsFromOai(r *oai.Response)
type Option ¶
func SetCreateTree ¶
func SetCreateTree(fn CreateTreeFn) Option
func SetDataDir ¶
func SetIndexService ¶
func SetProcessDigital ¶ added in v0.2.0
func SetProcessDigitalIfMissing ¶ added in v0.2.1
func SetRevisionService ¶ added in v0.2.0
func SetWorkers ¶ added in v0.1.10
type PreStoreFn ¶ added in v0.2.1
type ProcessingState ¶
type ProcessingState string
type Service ¶
type Service struct { M Metrics CreateTreeFn CreateTreeFn PreStoreFn PreStoreFn DaoFn DaoFn DaoClient *eadHub3.DaoClient // contains filtered or unexported fields }
func NewService ¶
func (*Service) AddPostHook ¶ added in v0.2.0
func (s *Service) AddPostHook(hook domain.PostHookService) error
AddPostHook adds posthook to the EAD service
func (*Service) CancelTask ¶
func (s *Service) CancelTask(w http.ResponseWriter, r *http.Request)
func (*Service) ClearRestrictions ¶ added in v0.2.0
func (s *Service) ClearRestrictions(w http.ResponseWriter, r *http.Request)
Call this function each night at 00:01 in a cron job to check and clear tree node restrictions.
func (*Service) CreateTask ¶ added in v0.2.0
func (*Service) LoadModifiedEADDate ¶ added in v0.2.0
LoadModifiedEADDate loads the modified date of the EAD or else zero time if not available.
func (*Service) ResyncCacheDir ¶ added in v0.2.0
func (*Service) SaveModifiedEADDate ¶ added in v0.2.0
SaveModifiedEADDate stores the modified EAD date.
func (*Service) StartWorkers ¶
type Task ¶
type Task struct { ID string `json:"id"` Meta *Meta InState ProcessingState `json:"inState"` ErrorMsg string `json:"errorMsg"` Transitions []*Transition `json:"transitions"` Interrupted bool // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.