appinit

package
v0.35.345 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: MIT Imports: 21 Imported by: 2 modules, 1 package

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

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