Documentation ¶
Overview ¶
Package numpin implements an ipfs-cluster informer which determines how many items this peer is pinning and returns it as api.Metric
Index ¶
Constants ¶
const (
DefaultMetricTTL = 10 * time.Second
)
These are the default values for a Config.
Variables ¶
var MetricName = "numpin"
MetricName specifies the name of our metric
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.2.0
Config allows to initialize an Informer.
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 Config's type.
func (*Config) LoadJSON ¶ added in v0.2.0
LoadJSON parses a raw JSON byte-slice 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.
func (*Informer) GetMetric ¶
GetMetric contacts the IPFSConnector component and requests the `pin ls` command. We return the number of pins in IPFS.