Documentation ¶
Index ¶
- func LoadHashes(file string) ([]string, error)
- func LoadList(file string) ([]string, error)
- func LoadListFilter(file string, filter func(string) string) ([]string, error)
- func OpenFS(conn string) (billy.Basic, error)
- type Database
- func (d *Database) DeleteReferences(ctx context.Context, init string) error
- func (d *Database) ReferencesWithInit(init string) ([]*model.Reference, error)
- func (d *Database) RepositoriesWithInit(init string) ([]string, error)
- func (d *Database) Repository(id string) (*model.Repository, error)
- func (d *Database) Siva() ([]string, error)
- type Repository
- func (w *Repository) Cancel()
- func (w *Repository) DefaultErrors(msg string, skipErrors bool)
- func (w *Repository) Dry(d bool)
- func (w *Repository) Errors(f func(error))
- func (r *Repository) Priority(p queue.Priority)
- func (r *Repository) Queue(ctx context.Context, list []string) error
- func (r *Repository) QueueOne(id string) error
- func (r *Repository) Retries(c int32)
- func (w *Repository) SkipErrors(e bool)
- func (w *Repository) Workers(n int)
- type Set
- type Siva
- func (s *Siva) Bucket(b int)
- func (w *Siva) Cancel()
- func (w *Siva) DefaultErrors(msg string, skipErrors bool)
- func (s *Siva) Delete(ctx context.Context, list []string) error
- func (s *Siva) DeleteOne(ctx context.Context, init string) error
- func (w *Siva) Dry(d bool)
- func (w *Siva) Errors(f func(error))
- func (s *Siva) Failed(req func(string) error)
- func (s *Siva) Queue(req func(string) error)
- func (s *Siva) Rebucket(ctx context.Context, list []string, to int) error
- func (s *Siva) RebucketOne(ctx context.Context, f string, to int) error
- func (w *Siva) SkipErrors(e bool)
- func (w *Siva) Workers(n int)
- func (s *Siva) WriteFailed(writer io.Writer)
- func (s *Siva) WriteQueue(writer io.Writer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadHashes ¶
LoadHashes loads siva hashes from a file and generates a list. The lines from the file are parsed so it accepts file lists with bucketing. This list is filtered so it does not contain repetitions and is sorted n lexicographic order.
func LoadListFilter ¶
LoadListFilter loads a list of strings, applies a filter function to each line, removes duplicates and returns it sorted lexicographically.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database has the db functionality used by the tool.
func NewDatabase ¶
NewDatabase creates and initializes a new Database struct.
func (*Database) DeleteReferences ¶
DeleteReferences removes all references hold in an init.
func (*Database) ReferencesWithInit ¶
ReferencesWithInit returns all references with an specific init.
func (*Database) RepositoriesWithInit ¶
RepositoriesWithInit returns all repositories with references to a specific init.
func (*Database) Repository ¶
func (d *Database) Repository(id string) (*model.Repository, error)
Repository finds and returns a repo by ID.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository has the information to manage repositories in the database and message queue.
func NewRepository ¶
func NewRepository(db *Database, q queue.Queue) *Repository
NewRepository creates and initializes a new Repository struct.
func (*Repository) DefaultErrors ¶
func (*Repository) Priority ¶
func (r *Repository) Priority(p queue.Priority)
Priority sets the priority level for new queued jobs.
func (*Repository) Queue ¶
func (r *Repository) Queue(ctx context.Context, list []string) error
Queue creates new jobs for the repositories in the provided list. It skips repositories that are not in a queueable state, by default Fetched or Fetching. After submitting the job the repository is set to Pending state.
func (*Repository) QueueOne ¶
func (r *Repository) QueueOne(id string) error
QueueOne queues one repository.
func (*Repository) Retries ¶
func (r *Repository) Retries(c int32)
Retries sets the retries value used in new queued jobs.
func (*Repository) SkipErrors ¶
func (w *Repository) SkipErrors(e bool)
type Siva ¶
type Siva struct {
// contains filtered or unexported fields
}
Siva deals with siva files and its database usage.
func (*Siva) DefaultErrors ¶
func (*Siva) Delete ¶
Delete removes all references to the siva files in a list, deletes its siva file and calls queue function for its repositories.
func (*Siva) DeleteOne ¶
DeleteOne deletes one siva file, its references and calls queue function for the related repositories.
func (*Siva) RebucketOne ¶
RebucketOne changes one siva file bucketing level.
func (*Siva) SkipErrors ¶
func (w *Siva) SkipErrors(e bool)
func (*Siva) WriteFailed ¶
WriteFailed sets a default function that writes to writer each failed job.
func (*Siva) WriteQueue ¶
WriteQueue sets a default function that writes to writer each repository id that has to be queued.