Documentation ¶
Overview ¶
Package disk implements an ipfs-cluster informer which can provide different disk-related metrics from the IPFS daemon as an api.Metric.
Index ¶
Constants ¶
const ( DefaultMetricTTL = 30 * time.Second DefaultMetricType = MetricFreeSpace )
Default values for disk Config
const ( // MetricFreeSpace provides the available space reported by IPFS MetricFreeSpace = iota // MetricRepoSize provides the used space reported by IPFS MetricRepoSize )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.2.0
type Config struct { config.Saver MetricTTL time.Duration Type MetricType }
Config is used to initialize an Informer and customize the type and parameters of the metric it produces.
func (*Config) ApplyEnvVars ¶ added in v0.10.0
ApplyEnvVars fills in any Config fields found as environment variables.
func (*Config) ConfigKey ¶ added in v0.2.0
ConfigKey returns a human-friendly identifier for this type of Metric.
func (*Config) LoadJSON ¶ added in v0.2.0
LoadJSON reads the fields of this Config from a JSON byteslice as generated by ToJSON.
type Informer ¶
type Informer struct {
// contains filtered or unexported fields
}
Informer is a simple object to implement the ipfscluster.Informer and Component interfaces.
func NewInformer ¶
NewInformer returns an initialized informer using the given InformerConfig.
type MetricType ¶ added in v0.2.0
type MetricType int
MetricType identifies the type of metric to fetch from the IPFS daemon.
func (MetricType) String ¶ added in v0.2.0
func (t MetricType) String() string
String returns a string representation for MetricType.