internal

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package internal provide private utilities for the CLI application.

Index

Constants

This section is empty.

Variables

View Source
var BuildCode string

BuildCode provides the commit identifier used to build the binary.

View Source
var BuildTimestamp string

BuildTimestamp provides the UNIX timestamp of the build.

View Source
var CoreVersion string

CoreVersion defines the semantic version of the build. If not available a short version of the commit hash will be used.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	Server *serverSettings `json:"server" yaml:"server" mapstructure:"server"`
	Otel   *otelSettings   `json:"otel" yaml:"otel" mapstructure:"otel"`
}

Settings provide utilities to manage configuration options available when utilizing the different components available through the CLI application.

func (*Settings) CORS

func (s *Settings) CORS() mwCors.Options

CORS provides a "Cross Origin Resource Sharing" middleware.

func (*Settings) Load

func (s *Settings) Load(v *viper.Viper) error

Load available config values from Viper into the settings instance.

func (*Settings) MetadataOptions

func (s *Settings) MetadataOptions() mwMetadata.Options

MetadataOptions return configuration settings required to adjust the behavior of the metadata middleware.

func (*Settings) OTEL

func (s *Settings) OTEL(log xlog.Logger) []otelSdk.Option

OTEL returns the configuration options available to enable OpenTelemetry instrumentation.

func (*Settings) Overrides

func (s *Settings) Overrides(cmd string) []cli.Param

Overrides return the available flag overrides for the command specified. Specific settings can be provided via: configuration file, ENV variable and command flags.

func (*Settings) ReleaseCode

func (s *Settings) ReleaseCode() string

ReleaseCode returns the release identifier for the application. A release identifier is of the form: `service-name@version+commit_hash`. If `version` or `commit_hash` are not available will be omitted.

func (*Settings) ServerOptions

func (s *Settings) ServerOptions(handler http.Handler, dir string, log xlog.Logger) []pkgHttp.Option

ServerOptions returns the configuration options available to set up an HTTP server instance.

func (*Settings) SetDefaults

func (s *Settings) SetDefaults(v *viper.Viper, appID string)

SetDefaults loads default values to the provided viper instance.

Jump to

Keyboard shortcuts

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