Documentation
¶
Overview ¶
Package telemetry provides functionality for telemetry logging.
Package telemetry provides functionality for telemetry logging.
Package telemetry provides functionality for telemetry logging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadEnv ¶
func LoadEnv(v interface{}) (err error)
LoadEnv is a function that loads environment variables from a .env file into a given struct. It uses the "env" tag in the struct to match the environment variables. If the .env file cannot be loaded or the environment variables cannot be parsed, it returns an error.
Types ¶
type Lib ¶
type Lib struct {
Level string `env:"TELEMETRY_LOG_LEVEL" envDefault:"debug" json:"level"`
Host string `env:"TELEMETRY_HOST" envDefault:"127.0.0.1" json:"host"`
Port string `env:"TELEMETRY_PORT" envDefault:"27017" json:"port"`
Username string `env:"TELEMETRY_USERNAME" envDefault:"username" json:"username"`
Password string `env:"TELEMETRY_PASSWORD" envDefault:"password" json:"password"`
Log log.Logger
// contains filtered or unexported fields
}
Lib is a struct that holds the necessary information for telemetry logging.
type MongoHook ¶
type MongoHook struct {
Client *mongo.Mongo // Client is a pointer to a Mongo instance.
Timeout time.Duration // Timeout is the duration before the hook times out.
WithHook bool // WithHook is a boolean that determines whether the hook is active.
}
MongoHook is a struct that holds the necessary information for a MongoDB hook.
type OptFunc ¶
OptFunc is a type that defines a function that modifies a Lib instance.
func WithHook ¶
WithHook is a function that returns an OptFunc which sets the hook for a Lib instance.
func WithJSONFormatter ¶
func WithJSONFormatter() OptFunc
WithJSONFormatter is a function that returns an OptFunc which sets the JSON formatter for a Lib instance.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package log provides an interface and functions for logging.
|
Package log provides an interface and functions for logging. |
|
Package mongo provides a wrapper around the mongo-driver package, simplifying the process of connecting to a MongoDB instance and performing operations on it.
|
Package mongo provides a wrapper around the mongo-driver package, simplifying the process of connecting to a MongoDB instance and performing operations on it. |