influxdb

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2016 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Maximum time to try and connect to InfluxDB during startup.
	DefaultStartUpTimeout           = 5 * time.Minute
	DefaultSubscriptionSyncInterval = 1 * time.Minute

	DefaultSubscriptionProtocol = "http"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled  bool     `toml:"enabled"`
	Name     string   `toml:"name"`
	Default  bool     `toml:"default"`
	URLs     []string `toml:"urls"`
	Username string   `toml:"username"`
	Password string   `toml:"password"`
	// Path to CA file
	SSLCA string `toml:"ssl-ca"`
	// Path to host cert file
	SSLCert string `toml:"ssl-cert"`
	// Path to cert key file
	SSLKey string `toml:"ssl-key"`
	// Use SSL but skip chain & host verification
	InsecureSkipVerify bool `toml:"insecure-skip-verify"`

	Timeout                  toml.Duration       `toml:"timeout"`
	DisableSubscriptions     bool                `toml:"disable-subscriptions"`
	SubscriptionProtocol     string              `toml:"subscription-protocol"`
	Subscriptions            map[string][]string `toml:"subscriptions"`
	ExcludedSubscriptions    map[string][]string `toml:"excluded-subscriptions"`
	UDPBind                  string              `toml:"udp-bind"`
	UDPBuffer                int                 `toml:"udp-buffer"`
	UDPReadBuffer            int                 `toml:"udp-read-buffer"`
	StartUpTimeout           toml.Duration       `toml:"startup-timeout"`
	SubscriptionSyncInterval toml.Duration       `toml:"subscriptions-sync-interval"`
}

func NewConfig

func NewConfig() Config

func (*Config) SetDefaultValues added in v1.0.0

func (c *Config) SetDefaultValues()

func (Config) Validate

func (c Config) Validate() error

type Service

type Service struct {
	PointsWriter interface {
		WritePoints(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, points []models.Point) error
	}
	LogService interface {
		NewLogger(string, int) *log.Logger
	}
	HTTPDService interface {
		AddRoutes([]httpd.Route) error
		DelRoutes([]httpd.Route)
	}
	ClientCreator interface {
		Create(influxdb.HTTPConfig) (influxdb.Client, error)
	}
	AuthService interface {
		GrantSubscriptionAccess(token, db, rp string) error
		ListSubscriptionTokens() ([]string, error)
		RevokeSubscriptionAccess(token string) error
	}
	RandReader io.Reader
	// contains filtered or unexported fields
}

Handles requests to write or read from an InfluxDB cluster

func NewService

func NewService(configs []Config, defaultInfluxDB, httpPort int, hostname string, useTokens bool, l *log.Logger) *Service

func (*Service) Close

func (s *Service) Close() error

func (*Service) LinkSubscriptions added in v1.0.0

func (s *Service) LinkSubscriptions() error

Trigger a linkSubscriptions event for all clusters

func (*Service) NewDefaultClient added in v0.11.0

func (s *Service) NewDefaultClient() (influxdb.Client, error)

func (*Service) NewNamedClient added in v0.11.0

func (s *Service) NewNamedClient(name string) (influxdb.Client, error)

func (*Service) Open

func (s *Service) Open() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL