constants

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package constants provides application-wide constant values used throughout the logger system. These constants define environment names, configuration keys, and other fixed values to ensure consistency across the codebase.

Index

Constants

View Source
const (
	// NonProductionEnvironment is the environment name for non-production environments.
	NonProductionEnvironment = "development"
	// DefaultTimeout is the default timeout for asynchronous logging.
	DefaultTimeout = 5 * time.Second
)
View Source
const (
	// TraceHeader is the default HTTP header for trace identifiers.
	TraceHeader = "X-Trace-ID"
	// RequestHeader is the default HTTP header for request identifiers.
	RequestHeader = "X-Request-ID"
)
View Source
const (

	// LogOutputStdout represents the standard output stream.
	LogOutputStdout OutputType = "stdout"
	// LogOutputStderr represents the standard error stream.
	LogOutputStderr OutputType = "stderr"
	// LogOutputFile represents a file output.
	LogOutputFile OutputType = "file"

	// TimeFormatUnix represents the Unix timestamp format.
	TimeFormatUnix TimeFormat = "unix"
	// TimeFormatUnixMs represents the Unix timestamp format with milliseconds.
	TimeFormatUnixMs TimeFormat = "unix_ms"
	// TimeFormatRFC3339 represents the RFC3339 timestamp format.
	TimeFormatRFC3339 TimeFormat = "rfc3339"
	// TimeFormatRFC represents the RFC3339 timestamp format.
	TimeFormatRFC TimeFormat = "rfc"
	// TimeFormatDefault represents the default timestamp format.
	TimeFormatDefault TimeFormat = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationKey

type ApplicationKey struct{}

ApplicationKey is the context key for the application field.

type ComponentKey

type ComponentKey struct{}

ComponentKey is the context key for the component field.

type EnvironmentKey

type EnvironmentKey struct{}

EnvironmentKey is the context key for the environment field.

type NamespaceKey

type NamespaceKey struct{}

NamespaceKey is the context key for the namespace field.

type OutputType

type OutputType string

OutputType represents the type of output.

func (OutputType) IsValid

func (o OutputType) IsValid() bool

IsValid returns true if the given OutputType is a valid output type, and false otherwise.

func (OutputType) String

func (o OutputType) String() string

String returns the string representation of the OutputType.

type RequestKey

type RequestKey struct{}

RequestKey is the context key for the request field.

type ServiceKey

type ServiceKey struct{}

ServiceKey is the context key for the service field.

type SessionKey

type SessionKey struct{}

SessionKey is the context key for the session field.

type TimeFormat

type TimeFormat string

TimeFormat represents the format of time.

func (TimeFormat) IsValid

func (t TimeFormat) IsValid() bool

IsValid returns true if the given TimeFormat is a valid time format, and false otherwise.

func (TimeFormat) String

func (t TimeFormat) String() string

String returns the string representation of the TimeFormat.

type TraceKey

type TraceKey struct{}

TraceKey is the context key for the trace field.

type UserKey

type UserKey struct{}

UserKey is the context key for the user field.

Jump to

Keyboard shortcuts

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