db

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(c Config) (*gorm.DB, error)

OpenDB initializes GORM using the configuration parameters.

Types

type Config

type Config struct {
	Host            string `yaml:"host"`
	Port            int    `yaml:"port"`
	Username        string `yaml:"username"`
	Database        string `yaml:"database"`
	PasswordEnvName string `yaml:"passwordEnvName"`
}

Config specifies the configurations to connect to the database.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

Jump to

Keyboard shortcuts

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