cfcomponent

package
v0.0.0-...-54c1187 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2014 License: Apache-2.0, BSD-3-Clause, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultYagnatsClientProvider = func(logger *gosteno.Logger, c *Config) (natsClient yagnats.NATSClient, err error) {
	members := []yagnats.ConnectionProvider{}
	for _, natsHost := range c.NatsHosts {
		members = append(members, &yagnats.ConnectionInfo{
			Addr:     fmt.Sprintf("%s:%d", natsHost, c.NatsPort),
			Username: c.NatsUser,
			Password: c.NatsPass,
		})
	}

	connectionInfo := &yagnats.ConnectionCluster{
		Members: members,
	}
	natsClient = yagnats.NewClient()
	err = natsClient.Connect(connectionInfo)
	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        uint32
	StatusCredentials []string
	Instrumentables   []instrumentation.Instrumentable
}

func NewComponent

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

func (Component) StartMonitoringEndpoints

func (c Component) StartMonitoringEndpoints() error

type Config

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

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