api

package
v0.0.0-...-8699099 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Config Config        // Config holds the configuration settings required for the application.
	DBPool *pgxpool.Pool // DBPool is a connection pool to the database used for executing queries and transactions.
}

Application represents the API application with its configuration settings and dependencies.

func (*Application) Run

func (app *Application) Run()

Run starts the HTTP server and gracefully shuts it down when interrupted. It handles server startup, shutdown, and logs relevant information.

type Config

type Config struct {
	Addr      string                 // Addr specifies the network address (host:port) on which the server will listen for incoming requests.
	DB        DBConfig               // DB holds the database configuration settings required for connecting to the database.
	EnvConfig env.EnvConfigInterface // EnvConfigInterface provides methods to retrieve environment variables.

}

Config holds the configuration settings for the API server.

type DBConfig

type DBConfig struct {
	Addr         string // Addr specifies the network address (host:port) of the database server.
	MaxOpenConns int    // MaxOpenConns is the maximum number of open connections to the database.
	MaxIdleConns int    // MaxIdleConns is the maximum number of idle connections to the database.
	MaxIdleTime  string // MaxIdleTime is the maximum amount of time a connection may be idle before being closed.
}

DBConfig holds the configuration settings for connecting to the database.

Jump to

Keyboard shortcuts

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