cfcomponent

package
v0.0.0-...-0848747 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2015 License: Apache-2.0, BSD-3-Clause, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultYagnatsClientProvider = func(logger *gosteno.Logger, c *Config) (natsClient yagnats.NATSConn, err error) {
	members := make([]string, 0)
	for _, natsHost := range c.NatsHosts {
		members = append(members, fmt.Sprintf("nats://%s:%s@%s:%d", c.NatsUser, c.NatsPass, natsHost, c.NatsPort))
	}

	natsClient, err = yagnats.Connect(members)
	if err != nil {
		return nil, errors.New(fmt.Sprintf("Could not connect to NATS: %v", err.Error()))
	}
	return natsClient, nil
}
View Source
var Logger *gosteno.Logger

Functions

func DumpGoRoutine

func DumpGoRoutine()

func GetNewSyslogSink

func GetNewSyslogSink(namespace string) *gosteno.Syslog

func NewLogger

func NewLogger(verbose bool, logFilePath, name string, config Config) *gosteno.Logger

func ReadConfigInto

func ReadConfigInto(config interface{}, configPath string) error

func RegisterGoRoutineDumpSignalChannel

func RegisterGoRoutineDumpSignalChannel() chan os.Signal

Types

type Component

type Component struct {
	*gosteno.Logger
	IpAddress         string
	HealthMonitor     HealthMonitor
	Type              string //Used by the collector to find data processing class
	Index             uint
	UUID              string
	StatusPort        uint16
	StatusCredentials []string
	Instrumentables   []instrumentation.Instrumentable
}

func NewComponent

func NewComponent(logger *gosteno.Logger, componentType string, index uint, heathMonitor HealthMonitor, statusPort uint16, statusCreds []string, instrumentables []instrumentation.Instrumentable) (Component, error)

func (Component) StartMonitoringEndpoints

func (c Component) StartMonitoringEndpoints() error

type Config

type Config struct {
	Syslog                                 string
	VarzPort                               uint16
	VarzUser                               string
	VarzPass                               string
	NatsHosts                              []string
	NatsPort                               int
	NatsUser                               string
	NatsPass                               string
	MbusClient                             yagnats.NATSConn
	CollectorRegistrarIntervalMilliseconds int
}

func (*Config) Validate

func (c *Config) Validate(logger *gosteno.Logger) (err error)

type HealthMonitor

type HealthMonitor interface {
	Ok() bool
}

Directories

Path Synopsis
registrars

Jump to

Keyboard shortcuts

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