appinit

package
v0.27.269 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUProfiler

func CPUProfiler(file string) (io.Closer, error)

CPUProfiler starts CPU profiles

func Logs

func Logs(flags *LogConfig, serviceName string) (io.Closer, error)

Logs initializes app logs

func Metrics

func Metrics(cfg *config.Metrics, svcName, clusterName string, version string, commitNumber int, describe []*metrics.Describe) (io.Closer, error)

Metrics initializer

Types

type Flags

type Flags struct {
	Version ctl.VersionFlag `name:"version" help:"Print version information and quit" hidden:""`

	Cfg         string `short:"c" help:"load configuration file"`
	CfgOverride string `help:"configuration override file"`
	CPUProfile  string `help:"enable CPU profiling, specify a file to store CPU profiling info"`
	DryRun      bool   `help:"verify config etc, and do not start the service"`

	ClientCert      string `help:"Path to the client TLS cert file"`
	ClientKey       string `help:"Path to the client TLS key file"`
	ClientTrustedCA string `help:"Path to the client TLS trusted CA file"`
	Env             string `help:"Override environment value"`
	ServiceName     string `help:"Override service value"`
	Region          string `help:"Override region value"`
	Cluster         string `help:"Override cluster value"`

	WaitOnExit int `help:"Number of seconds to wait on exist"`
}

Flags defines common flags

type LogConfig

type LogConfig struct {
	LogStd         bool   `help:"output logs to stderr"`
	LogDebug       bool   `help:"output logs with debug info, such as filename:line"`
	LogPretty      bool   `help:"output logs in pretty format, with colors"`
	LogJSON        bool   `help:"output logs in JSON format"`
	LogStackdriver bool   `help:"output logs in GCP stackdriver format"`
	LogDir         string `help:"Store logs in folder"`
}

LogConfig defines config for logs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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