storj/pkg/datarepair/checker/config.go
Jennifer Li Johnson 0e7f6358fb
creates configs for data repair package (#463)
* creates configs
2018-10-12 13:49:49 -04:00

32 lines
788 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package checker
import (
"context"
"time"
"storj.io/storj/pkg/provider"
)
// Config contains configurable values for repairer
type Config struct {
QueueAddress string `help:"data repair queue address" default:"redis://localhost:6379?db=5&password=123"`
Interval time.Duration `help:"how frequently checker should audit segments" default:"30s"`
}
// Initialize a Checker struct
func (c Config) initialize(ctx context.Context) (Checker, error) {
return &checker{}, nil
}
// Run runs the checker with configured values
func (c Config) Run(ctx context.Context, server *provider.Provider) (err error) {
check, err := c.initialize(ctx)
if err != nil {
return err
}
return check.Run()
}