import ( "github.com/influxdb/influxdb/meta" ) func createDatabase(name string) error { m, err := meta.DefaultMeta() if err != nil { return err } return m.CreateDatabase(name) }
import ( "github.com/influxdb/influxdb/meta" ) func addUser(name string, password string) error { m, err := meta.DefaultMeta() if err != nil { return err } return m.CreateUser(name, password) }These examples demonstrate how the MetaData API can be used to manage the metadata for InfluxDB. With this package, it is possible to manage and manipulate data retention policies, users, databases, and much more.