cservice

package module
v0.0.0-...-4ae65f9 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 3 Imported by: 1

README

cservice

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDatabase

func InitDatabase(config *DatabaseConfig) error

"root:root@tcp(localhost:3306)/user-service?charset=utf8&parseTime=True&loc=Local", &gorm.Config{}

Types

type DatabaseConfig

type DatabaseConfig struct {
	// User to connect to the database as.
	User string

	// Password to authenticate the user.
	Password string

	// Host URL to connect to.
	Host string

	// Port the server is exposed on.
	Port int

	// Database to use.
	Database string

	// Models to auto-migrate.
	Models []interface{}

	// ExtraConfig defines the GORM configuration options.
	ExtraConfig *gorm.Config
}

DatabaseConfig defines the settings required to initialise a MySQL database connection.

Jump to

Keyboard shortcuts

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