{"modulePath":"github.com/netdata/go.d.plugin","version":"v0.58.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package netdataapi\n\n## Types\n\n```go\ntype API struct {\n\tio.Writer\n}\n```\nAPI implements Netdata external plugins API. [https://learn.netdata.cloud/docs/agent/collectors/plugins.d#the-output-of-the-plugin](https://learn.netdata.cloud/docs/agent/collectors/plugins.d#the-output-of-the-plugin)\n\n```go\nfunc New(w io.Writer) *API\n```\n\n```go\nfunc (a *API) BEGIN(typeID string, ID string, msSince int) (err error)\n```\nBEGIN initializes data collection for a chart.\n\n```go\nfunc (a *API) CHART(\n\ttypeID string,\n\tID string,\n\tname string,\n\ttitle string,\n\tunits string,\n\tfamily string,\n\tcontext string,\n\tchartType string,\n\tpriority int,\n\tupdateEvery int,\n\toptions string,\n\tplugin string,\n\tmodule string) error\n```\nCHART  creates or update a chart.\n\n```go\nfunc (a *API) CLABEL(key, value string, source int) error\n```\nCLABEL adds or update a label to the chart.\n\n```go\nfunc (a *API) CLABELCOMMIT() error\n```\nCLABELCOMMIT adds labels to the chart. Should be called after one or more CLABEL.\n\n```go\nfunc (a *API) DIMENSION(\n\tID string,\n\tname string,\n\talgorithm string,\n\tmultiplier int,\n\tdivisor int,\n\toptions string) error\n```\nDIMENSION adds or update a dimension to the chart just created.\n\n```go\nfunc (a *API) DISABLE() error\n```\nDISABLE disables this plugin. This will prevent Netdata from restarting the plugin.\n\n```go\nfunc (a *API) DynCfgEnable(pluginName string) error\n```\n\n```go\nfunc (a *API) DynCfgRegisterJob(moduleName, jobName, jobType string) error\n```\n\n```go\nfunc (a *API) DynCfgReportJobStatus(moduleName, jobName, status, reason string) error\n```\n\n```go\nfunc (a *API) DynCfgReset() error\n```\n\n```go\nfunc (a *API) DyncCfgRegisterModule(moduleName string) error\n```\n\n```go\nfunc (a *API) EMPTYLINE() error\n```\nEMPTYLINE writes an empty line.\n\n```go\nfunc (a *API) END() error\n```\nEND completes data collection for the initialized chart.\n\n```go\nfunc (a *API) FunctionResultReject(uid, contentType, payload string) error\n```\n\n```go\nfunc (a *API) FunctionResultSuccess(uid, contentType, payload string) error\n```\n\n```go\nfunc (a *API) HOST(guid string) error\n```\n\n```go\nfunc (a *API) HOSTDEFINE(guid, hostname string) error\n```\n\n```go\nfunc (a *API) HOSTDEFINEEND() error\n```\n\n```go\nfunc (a *API) HOSTINFO(guid, hostname string, labels map[string]string) error\n```\n\n```go\nfunc (a *API) HOSTLABEL(name, value string) error\n```\n\n```go\nfunc (a *API) SET(ID string, value int64) error\n```\nSET sets the value of a dimension for the initialized chart.\n\n```go\nfunc (a *API) SETEMPTY(ID string) error\n```\nSETEMPTY sets the empty value of a dimension for the initialized chart.\n\n```go\nfunc (a *API) VARIABLE(ID string, value int64) error\n```\nVARIABLE sets the value of a CHART scope variable for the initialized chart.\n\n","path":"github.com/netdata/go.d.plugin/agent/netdataapi","name":"netdataapi","synopsis":"","isRedistributable":true}
