Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadConfigFile ¶
ReadConfigFile reads the config file and returns the data. It also expands any environment variables in the config file.
func ResetStats ¶
func ResetStats()
ResetStats resets the expvar stats for this module. Mostly for test purposes.
Types ¶
type Config ¶
type Config struct { Version int `json:"version"` Type auto.StorageType `json:"type"` NoCompress bool `json:"no_compress,omitempty"` Timestamp bool `json:"timestamp"` Vacuum bool `json:"vacuum,omitempty"` Interval auto.Duration `json:"interval"` Sub json.RawMessage `json:"sub"` }
Config is the config file format for the upload service
type DataProvider ¶
type DataProvider interface { // LastIndex returns the cluster-wide index the data managed by the DataProvider was // last modified by. LastIndex() (uint64, error) // Provide writes the data-for-upload to the writer. Provide(w io.Writer) error }
DataProvider is an interface for providing data to be uploaded. The Uploader service will call Provide() to have the data-for-upload to be written to the to the file specified by path.
type StorageClient ¶
type StorageClient interface { // Upload uploads the data from the given reader to the storage service. // id is a identifier for the data, and will be stored along with // the data in the storage service. Upload(ctx context.Context, reader io.Reader, id string) error // CurrentID returns the ID of the data in the Storage service. // It is always read from the Storage service, and a cached // value is never returned. CurrentID(ctx context.Context) (string, error) fmt.Stringer }
StorageClient is an interface for uploading data to a storage service.
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader is a service that periodically uploads data to a storage service.
func NewUploader ¶
func NewUploader(storageClient StorageClient, dataProvider DataProvider, interval time.Duration) *Uploader
NewUploader creates a new Uploader service.
Click to show internal directories.
Click to hide internal directories.