Documentation ¶
Index ¶
- Constants
- Variables
- type HarvestCallback
- type HarvestInfo
- type HarvestMetrics
- type HarvestTask
- func (ht *HarvestTask) BuildRequest() *oai.Request
- func (ht *HarvestTask) GetLastCheck() time.Time
- func (ht *HarvestTask) GetPage(ctx context.Context, request *oai.Request) (*oai.Response, error)
- func (ht *HarvestTask) Harvest(ctx context.Context) error
- func (ht *HarvestTask) SetLastCheck(t time.Time)
- func (ht *HarvestTask) SetRelativeFrom()
- func (ht *HarvestTask) SetUnixStartFrom()
- type Option
- type Service
Constants ¶
View Source
const ( VerbListRecords = "ListRecords" VerbListIdentifiers = "ListIdentifiers" DateFormat = "2006-01-02T15:04:05Z" UnixStart = "1970-01-01T12:00:00Z" )
Variables ¶
View Source
var ErrNoRecordsMatch = errors.New("no records match OAI-PMH request")
Functions ¶
This section is empty.
Types ¶
type HarvestCallback ¶
type HarvestInfo ¶
type HarvestMetrics ¶
type HarvestTask ¶
type HarvestTask struct { OrgID string Name string CheckEvery time.Duration HarvestInfo *HarvestInfo Request oai.Request CallbackFn HarvestCallback Client *http.Client // contains filtered or unexported fields }
func (*HarvestTask) BuildRequest ¶
func (ht *HarvestTask) BuildRequest() *oai.Request
func (*HarvestTask) GetLastCheck ¶
func (ht *HarvestTask) GetLastCheck() time.Time
GetLastCheck returns last time the task has run.
func (*HarvestTask) SetLastCheck ¶
func (ht *HarvestTask) SetLastCheck(t time.Time)
SetLastCheck sets time the task has run.
func (*HarvestTask) SetRelativeFrom ¶
func (ht *HarvestTask) SetRelativeFrom()
SetRelativeFrom sets the From param based on the last check minus the duration check.
func (*HarvestTask) SetUnixStartFrom ¶
func (ht *HarvestTask) SetUnixStartFrom()
SetUnixStartFrom sets the From param to unix start datetime.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddTask ¶
func (s *Service) AddTask(task ...*HarvestTask) error
func (*Service) HarvestNow ¶
func (s *Service) HarvestNow(w http.ResponseWriter, r *http.Request)
HarvestNow starts all harvest task from the beginning.
func (*Service) StartHarvestSync ¶
Click to show internal directories.
Click to hide internal directories.