config

package
v0.0.0-...-7b190fc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ENV_PREFIX = "tr"

Variables

This section is empty.

Functions

func DBConnect

func DBConnect() (db.DB, error)

DBConnect establishes a connection to the database using the connection parameters from the environment.

func DBDSN

func DBDSN() string

DB_DSN returns the SQLite Data Source Name. Default is "embedded.db"

func DBHost

func DBHost() string

DBHost returns the database host

func DBName

func DBName() string

DBName returns the database name

func DBPassword

func DBPassword() string

DBPassword returns the database password

func DBPort

func DBPort() int

DBPort returns the database port

func DBRetryAttempts

func DBRetryAttempts() int

DBRetryAttempts returns the max number of re-ties on DB connection request failure

func DBRetryInterval

func DBRetryInterval() int

DBRetryInterval returns interval to wait for before retrying. (in seconds)

func DBRetryJitter

func DBRetryJitter() int

DBRetryInterval returns additional random time (in seconds) between 0 and this, to be added to the wait time.

func DBSSLMode

func DBSSLMode() bool

DBSSLMode returns the database SSL mode.

func DBType

func DBType() string

DBType returns the database type chosen. Default is postgres

func DBUser

func DBUser() string

DBUser returns the database user

func FarmDefault

func FarmDefault() string

FarmDefault link to the farm repo being utilized

func LoadDefaults

func LoadDefaults()

func LogFormat

func LogFormat() string

LogFormat JSON or TEXT (case insensitive)

func LogLevel

func LogLevel() string

LogLevel one of: "panic", "fatal", "error", "warn", "warning", "info", "debug", "trace" (case sensitive)

func LogPrettyPrint

func LogPrettyPrint() bool

LogPrettyPrint for JSON it means indentation on, for TEXT it means force color

func LoggerConfig

func LoggerConfig(logger *logrus.Logger)

LoggerConfig sets up the given logger with defined configuration.

Example: To update standard logger configuration, do this:

LoggerConfig(logrus.StandardLogger())

func LoggerConfigDefault

func LoggerConfigDefault()

LoggerConfigDefault sets up the default loggers with defined configuration.

func ServerGRPCPort

func ServerGRPCPort() int

ServerGRPCPort port to run GRPC server on

func ServerHTTPPort

func ServerHTTPPort() int

ServerHTTPPort port to run http server on

Types

This section is empty.

Jump to

Keyboard shortcuts

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