shared

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APPLICATION_NAME   = "example1"
	APPLICATION_TITLE  = "example 1 title"
	APPLICATION_BANNER = "example 1 banner"

	APPLICATION_ENVIRONMENT_VARIABLE_PREFIX = "example1"
)

Variables

View Source
var (
	Flags  *application.Flags
	Params = application.Params{
		Use:     APPLICATION_NAME,
		Short:   APPLICATION_TITLE,
		Long:    APPLICATION_BANNER,
		Version: "",
		Configuration: configuration.Params{
			File: flagParams.StringVar{
				Name:      "configFile",
				Shorthand: "",
				Value:     "config.yaml",
				Usage:     "config file name",
			},
			SearchPaths: flagParams.StringSliceVar{
				Name:      "configSearchPaths",
				Shorthand: "",
				Value: []string{
					"$PWD",
				},
				Usage: "list of search paths",
			},
			Env: configuration.EnvFlagParams{
				Prefix: APPLICATION_ENVIRONMENT_VARIABLE_PREFIX,
				Keys: []string{
					"hostname",
					"port",
				},
			},
		},
		Log: logging.Params{
			Enabled: flagParams.BoolVar{
				Name:      "log",
				Shorthand: "l",
				Value:     false,
				Usage:     "specify flag to enable logging [-l]",
			},
			Level: flagParams.StringVar{
				Name:      "loglevel",
				Shorthand: "",
				Value:     "error",
				Usage:     "[error|warn|info|debug]",
			},
			Format: flagParams.StringVar{
				Name:      "logformat",
				Shorthand: "",
				Value:     "json",
				Usage:     "[json|text]",
			},
			Target: flagParams.StringVar{
				Name:      "logtarget",
				Shorthand: "",
				Value:     "console",
				Usage:     "[console|file] (default: console)",
			},
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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