app

package
v1.58.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 14

Documentation

Overview

Package app has the static app info

Index

Constants

This section is empty.

Variables

View Source
var Version = defaultVersion

Version needs to be set at build time using -ldflags "-X github.com/getoutreach/gobox/pkg/app.Version=something"

Functions

func SetName

func SetName(name string)

SetName sets the app name

Should only be called from tests and app initialization

Types

type Data

type Data struct {
	Name    string
	Version string

	MainModule string

	Environment    string
	Namespace      string
	ServiceAccount string
	ClusterName    string
	Region         string
	PodID          string
	NodeID         string
	Deployment     string

	// ServiceID is a unique identifier for the service used primarily
	// within the `authn` framework.
	ServiceID string

	Bento string
	// contains filtered or unexported fields
}

Data provides the global app info

func Info

func Info() *Data

Info returns the static app info

This struct is used mainly to provide tags to append to logs. It's also used by a handful of infrastructure-y packages like Mint or orgservice that have special needs. Most services will never need to access it directly.

func (*Data) MarshalLog

func (d *Data) MarshalLog(addField func(key string, v interface{}))

MarshalLog marshals the struct for logging

Jump to

Keyboard shortcuts

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