|
1 | | -# Environment Variables |
2 | | - |
3 | | -## Config |
4 | | - |
5 | | - - `API_ENVIRONMENT` (default: `development`) - Environment specifies the current running environment of the API. |
6 | | - - `API_DEBUG_MODE` (default: `false`) - DebugMode enables/disables detailed debugging output. |
7 | | - - `API_DB_ADDR` (default: `localhost`) - Host address of the database to connect to. |
8 | | - - `API_DB_PORT` (default: `5432`) - Port of the database to connect to. |
9 | | - - `API_DB_USER` (**required**) - User for the database authentication. |
10 | | - - `API_DB_PASS` (**required**) - Pass (password) for the database authentication. |
11 | | - - `API_DB_NAME` (**required**) - Name of the database to connect to. |
12 | | - - `API_DB_SSL_MODE` (default: `disable`) - SslMode of the database connection. |
13 | | - - `API_DB_MAX_CONNECTIONS` (default: `25`) - MaxConns is the maximum connections that can be created by the database connection pool. |
14 | | - - `API_DB_MAX_CONNECTION_LIFETIME` (default: `2h`) - MaxConnLifetime is the duration since creation after which a connection will be automatically closed. |
15 | | - - `API_DB_MAX_CONNECTION_IDLE_TIME` (default: `5m`) - MaxConnIdleTime is the duration after which an idle connection will be automatically closed. |
16 | | - - `API_CACHE_HOST` (default: `localhost`) - Host specifies the address of the cache server. |
17 | | - - `API_CACHE_PORT` (default: `6379`) - Port defines the port number on which the cache server will listen. |
18 | | - - `API_CACHE_PASSWORD` - Password of the cache server. |
19 | | - - `API_CACHE_DATABASE` (default: `0`) - Database specifies the cache database number to connect to. |
20 | | - - `API_SERVER_HTTP_PORT` (**required**) - HttpPort defines the port number on which the HTTP server will listen for incoming connections. |
21 | | - - `API_SERVER_BASE_URL` - BaseUrl specifies the base URL used for constructing server-related endpoints. |
22 | | - - `API_SERVER_IDLE_TIMEOUT` (default: `1m`) - IdleTimeout is the duration the server will wait for the next request before closing idle connections when keep-alives are enabled. |
23 | | - - `API_SERVER_READ_TIMEOUT` (default: `5s`) - ReadTimeout specifies the maximum duration for reading an entire request, including the body. |
24 | | - - `API_SERVER_WRITE_TIMEOUT` (default: `15s`) - WriteTimeout defines the maximum duration for writing a response before timing out. |
25 | | - - `API_SERVER_REQUEST_TIMEOUT` (default: `10s`) - RequestTimeout specifies the maximum duration for handlers to run. |
26 | | -It should be lower than WriteTimeout as no response will be returned if a handler's runtime exceeds the write timeout. |
27 | | - - `API_SERVER_SHUTDOWN_TIMEOUT` (default: `30s`) - ShutdownTimeout specifies the duration the server will wait to wrap up active connections and background operations for a graceful shutdown. |
28 | | - - `API_AUTH_JWT_ISSUER` (default: `go-backend-template`) - JwtIssuer specifies the issuer of the JWT, determining the entity responsible for generating the token. |
29 | | - - `API_AUTH_JWT_ACCESS_TOKEN_SECRET` - JwtAccessTokenSecret is the secret key used to sign and validate JWT access tokens. |
30 | | - - `API_AUTH_JWT_REFRESH_TOKEN_SECRET` - JwtRefreshTokenSecret is the secret key used to sign and validate JWT refresh tokens. |
31 | | - - `API_AUTH_JWT_ACCESS_TOKEN_DURATION` (default: `1h`) - JwtAccessTokenDuration defines the lifespan of JWT access tokens before they expire. |
32 | | - - `API_AUTH_JWT_REFRESH_TOKEN_DURATION` (default: `12h`) - JwtRefreshTokenDuration specifies the duration for which a JWT refresh token remains valid before expiration. |
33 | | - - `API_AUTH_OTP_DURATION` (default: `30s`) - OtpDuration defines the time duration for which an OTP remains valid before expiring. |
34 | | - - `API_SMTP_HOST` (default: `localhost`) - Host specifies the SMTP server address. |
35 | | - - `API_SMTP_PORT` (default: `587`) - Port specifies the port number for the SMTP server. |
36 | | - - `API_SMTP_USER` - User specifies the username required for SMTP authentication. |
37 | | - - `API_SMTP_PASSWORD` - Password specifies the password required for SMTP authentication. |
38 | | - - `API_SMTP_SENDER` - Sender defines the email address used as the sender in SMTP communications. |
39 | | - - `API_OTEL_SERVICE_NAME` (default: `go-backend-template`) - ServiceName defines the name of the service used for observability and telemetry. |
40 | | - - `API_OTEL_OTLP_GRPC_HOST` (default: `localhost`) - OtlpGrpcHost defines the host address for the OTLP gRPC exporter. |
41 | | - - `API_OTEL_OTLP_GRPC_PORT` (default: `4317`) - OtlpGrpcPort specifies the port number for the OTLP gRPC exporter. |
42 | | - - `API_OTEL_OTLP_SECURE_CONNECTION` (default: `false`) - OtlpSecureConnection determines if a secure (TLS) connection should be used for OTLP communication. |
| 1 | +# API |
43 | 2 |
|
| 3 | +| Name | Description | Default | Attributes | |
| 4 | +|------|-------------|---------|------------| |
| 5 | +| `API_ENVIRONMENT` | Environment specifies the current running environment of the API. | `development` | | |
| 6 | +| `API_DEBUG_MODE` | DebugMode enables/disables detailed debugging output. | `false` | | |
| 7 | +| `API_SERVER_HTTP_PORT` | HttpPort defines the port number on which the HTTP server will listen for incoming connections. | | `REQUIRED` | |
| 8 | +| `API_SERVER_BASE_URL` | BaseUrl specifies the base URL used for constructing server-related endpoints. | | | |
| 9 | +| `API_SERVER_IDLE_TIMEOUT` | IdleTimeout is the duration the server will wait for the next request before closing idle connections when keep-alives are enabled. | `1m` | | |
| 10 | +| `API_SERVER_READ_TIMEOUT` | ReadTimeout specifies the maximum duration for reading an entire request, including the body. | `5s` | | |
| 11 | +| `API_SERVER_WRITE_TIMEOUT` | WriteTimeout defines the maximum duration for writing a response before timing out. | `15s` | | |
| 12 | +| `API_SERVER_REQUEST_TIMEOUT` | RequestTimeout specifies the maximum duration for handlers to run.<br>It should be lower than WriteTimeout as no response will be returned if a handler's runtime exceeds the write timeout. | `10s` | | |
| 13 | +| `API_SERVER_SHUTDOWN_TIMEOUT` | ShutdownTimeout specifies the duration the server will wait to wrap up active connections and background operations for a graceful shutdown. | `30s` | | |
| 14 | +| `API_DB_ADDR` | Host address of the database to connect to. | `localhost` | | |
| 15 | +| `API_DB_PORT` | Port of the database to connect to. | `5432` | | |
| 16 | +| `API_DB_USER` | User for the database authentication. | | `REQUIRED` | |
| 17 | +| `API_DB_PASS` | Pass (password) for the database authentication. | | `REQUIRED` | |
| 18 | +| `API_DB_NAME` | Name of the database to connect to. | | `REQUIRED` | |
| 19 | +| `API_DB_SSL_MODE` | SslMode of the database connection. | `disable` | | |
| 20 | +| `API_DB_MAX_CONNECTIONS` | MaxConns is the maximum connections that can be created by the database connection pool. | `25` | | |
| 21 | +| `API_DB_MAX_CONNECTION_LIFETIME` | MaxConnLifetime is the duration since creation after which a connection will be automatically closed. | `2h` | | |
| 22 | +| `API_DB_MAX_CONNECTION_IDLE_TIME` | MaxConnIdleTime is the duration after which an idle connection will be automatically closed. | `5m` | | |
| 23 | +| `API_CACHE_HOST` | Host specifies the address of the cache server. | `localhost` | | |
| 24 | +| `API_CACHE_PORT` | Port defines the port number on which the cache server will listen. | `6379` | | |
| 25 | +| `API_CACHE_PASSWORD` | Password of the cache server. | | | |
| 26 | +| `API_CACHE_DATABASE` | Database specifies the cache database number to connect to. | `0` | | |
| 27 | +| `API_AUTH_JWT_ISSUER` | JwtIssuer specifies the issuer of the JWT, determining the entity responsible for generating the token. | `go-backend-template` | | |
| 28 | +| `API_AUTH_JWT_ACCESS_TOKEN_SECRET` | JwtAccessTokenSecret is the secret key used to sign and validate JWT access tokens. | | | |
| 29 | +| `API_AUTH_JWT_REFRESH_TOKEN_SECRET` | JwtRefreshTokenSecret is the secret key used to sign and validate JWT refresh tokens. | | | |
| 30 | +| `API_AUTH_JWT_ACCESS_TOKEN_DURATION` | JwtAccessTokenDuration defines the lifespan of JWT access tokens before they expire. | `1h` | | |
| 31 | +| `API_AUTH_JWT_REFRESH_TOKEN_DURATION` | JwtRefreshTokenDuration specifies the duration for which a JWT refresh token remains valid before expiration. | `12h` | | |
| 32 | +| `API_AUTH_OTP_DURATION` | OtpDuration defines the time duration for which an OTP remains valid before expiring. | `30s` | | |
| 33 | +| `API_SMTP_HOST` | Host specifies the SMTP server address. | `localhost` | | |
| 34 | +| `API_SMTP_PORT` | Port specifies the port number for the SMTP server. | `587` | | |
| 35 | +| `API_SMTP_USER` | User specifies the username required for SMTP authentication. | | | |
| 36 | +| `API_SMTP_PASSWORD` | Password specifies the password required for SMTP authentication. | | | |
| 37 | +| `API_SMTP_SENDER` | Sender defines the email address used as the sender in SMTP communications. | | | |
| 38 | +| `API_OTEL_SERVICE_NAME` | ServiceName defines the name of the service used for observability and telemetry. | `go-backend-template` | | |
| 39 | +| `API_OTEL_OTLP_GRPC_HOST` | OtlpGrpcHost defines the host address for the OTLP gRPC exporter. | `localhost` | | |
| 40 | +| `API_OTEL_OTLP_GRPC_PORT` | OtlpGrpcPort specifies the port number for the OTLP gRPC exporter. | `4317` | | |
| 41 | +| `API_OTEL_OTLP_SECURE_CONNECTION` | OtlpSecureConnection determines if a secure (TLS) connection should be used for OTLP communication. | `false` | | |
0 commit comments