Documentation ¶
Overview ¶
Defines and initiates a Configuration struct
Package core defines core API objects and functions (e.g. database, security and config methods). The file database.go defines the database object.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = settings{ Api: ApiConfig{ Name: getEnv("API_NAME", "go-api"), Version: getEnv("API_VERSION", "v1"), Mode: getEnv("GIN_MODE", "debug"), }, Server: ServerConfig{ Host: getEnv("HOST", "0.0.0.0"), Port: getEnv("PORT", "8000"), }, Database: DatabaseConfig{ Dialect: getEnv("DATABASE_DIALECT", "sqlite"), Uri: getEnv("DATABASE_URI", "main.db"), }, }
Config is public configuration object.
Functions ¶
Types ¶
type DatabaseConfig ¶
type DatabaseI ¶
func NewDatabase ¶
NewDatabase is the database struct constructor.
type HTTPError ¶
type HTTPError struct { Code int `json:"code" example:"400"` Message string `json:"message" example:"status bad request"` }
HTTPError example
type HTTPSuccess ¶
type HTTPSuccess struct { Code int `json:"code" example:"200"` Message string `json:"message" example:"request completed"` }
HTTPError example
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.