common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version current version - semantic format
	Version string
	// BuildTime time of the build
	BuildTime string
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Nsq        NsqConfig
	LogLevel   string
	Kubernetes KubernetesConfig
	InfluxDB   InfluxDbConfig
	Rules      []RulesConfig
}

func NewConfig

func NewConfig() Config

type InfluxDbConfig

type InfluxDbConfig struct {
	Address         string
	Username        string
	Password        string
	Database        string
	Measurement     string
	RetentionPolicy string
	SendInterval    time.Duration
}

type KubernetesConfig

type KubernetesConfig struct {
	AnnotationKey string
}

type NSQLogrusLogger

type NSQLogrusLogger struct{}

NSQLogrusLogger is an adaptor between the weird go-nsq Logger and our standard logrus logger.

func NewNSQLogrusLogger

func NewNSQLogrusLogger() (logger NSQLogrusLogger, level nsq.LogLevel)

NewNSQLogrusLogger returns a new NSQLogrusLogger and the current log level. This is a format to easily plug into nsq.SetLogger.

func NewNSQLogrusLoggerAtLevel

func NewNSQLogrusLoggerAtLevel(l log.Level) (logger NSQLogrusLogger, level nsq.LogLevel)

NewNSQLogrusLoggerAtLevel returns a new NSQLogrusLogger with the provided log level mapped to nsq.LogLevel for easily plugging into nsq.SetLogger.

func (NSQLogrusLogger) Output

func (n NSQLogrusLogger) Output(_ int, s string) error

Output implements stdlib log.Logger.Output using logrus Decodes the go-nsq log messages to figure out the log level

type NsqConfig

type NsqConfig struct {
	Address      string
	Topic        string
	Channel      string
	ClientConfig *nsq.Config
}

type RulesConfig

type RulesConfig struct {
	Id             string
	UrlRegexp      string
	FrontendRegexp string
	Sampling       float64
}

type VersionInfo

type VersionInfo struct {
	Version   string `json:"version"`
	BuildTime string `json:"build_time"`
}

VersionInfo holds the information about current app version

func GetCurrentVersion

func GetCurrentVersion() VersionInfo

GetCurrentVersion returns information about current version of the app

func (VersionInfo) String

func (v VersionInfo) String() string

Jump to

Keyboard shortcuts

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