Documentation ¶
Index ¶
- Constants
- Variables
- func GetOrgFromEndpoint(endpoint string) string
- func NewDownloadJobScheduleFn(lib borges.Library, download chan gitcollector.Job, downloadFn JobFn, ...) gitcollector.JobScheduleFn
- func NewJobScheduleFn(lib borges.Library, download, update chan gitcollector.Job, ...) gitcollector.JobScheduleFn
- func NewRepositoryID(endpoint string) (borges.RepositoryID, error)
- func NewUpdateJobScheduleFn(lib borges.Library, update chan gitcollector.Job, updateFn JobFn, ...) gitcollector.JobScheduleFn
- type AuthTokenFn
- type Job
- type JobFn
- type JobType
Constants ¶
View Source
const ( // JobDownload represents a Download Job. JobDownload = 1 << iota // JobUpdate represents an Update Job. JobUpdate )
Variables ¶
View Source
var ( // ErrNotSivaLibrary is returned when a borges.Library is not a // siva.Library ErrNotSivaLibrary = errors.NewKind("not siva library found") // ErrNotSivaLocation is returned when a borges.Library is no a // siva.Location ErrNotSivaLocation = errors.NewKind("not siva location found") )
View Source
var ( // ErrJobFnNotFound is returned when theres is no function to // process a job. ErrJobFnNotFound = errors.NewKind( "process function not found for library.Job") )
Functions ¶
func GetOrgFromEndpoint ¶
GetOrgFromEndpoint retrieve the organization from an endpoint.
func NewDownloadJobScheduleFn ¶
func NewDownloadJobScheduleFn( lib borges.Library, download chan gitcollector.Job, downloadFn JobFn, updateOnDownload bool, authTokens map[string]string, jobLogger log.Logger, temp billy.Filesystem, ) gitcollector.JobScheduleFn
NewDownloadJobScheduleFn builds a new gitcollector.ScheduleFn that only schedules download jobs.
func NewJobScheduleFn ¶
func NewJobScheduleFn( lib borges.Library, download, update chan gitcollector.Job, downloadFn, updateFn JobFn, updateOnDownload bool, authTokens map[string]string, jobLogger log.Logger, temp billy.Filesystem, ) gitcollector.JobScheduleFn
NewJobScheduleFn builds a new gitcollector.ScheduleFn that schedules download and update jobs in different queues.
func NewRepositoryID ¶
NewRepositoryID builds a borges.RepositoryID from the given endpoint.
func NewUpdateJobScheduleFn ¶
func NewUpdateJobScheduleFn( lib borges.Library, update chan gitcollector.Job, updateFn JobFn, authTokens map[string]string, jobLogger log.Logger, ) gitcollector.JobScheduleFn
NewUpdateJobScheduleFn builds a new gitcollector.SchedulerFn that only schedules update jobs.
Types ¶
type AuthTokenFn ¶
AuthTokenFn retrieve and authentication token if any for the given endpoint.
type Job ¶
type Job struct { ID string Type JobType Lib borges.Library TempFS billy.Filesystem LocationID borges.LocationID AllowUpdate bool AuthToken AuthTokenFn ProcessFn JobFn Logger log.Logger // contains filtered or unexported fields }
Job represents a gitcollector.Job to perform a task on a borges.Library.
func (*Job) SetEndpoints ¶ added in v0.1.0
TODO: we should probably secure other fiels
Click to show internal directories.
Click to hide internal directories.