typpostgres

package
v0.8.29 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configuration added in v0.8.25

func Configuration(s *Settings) *typgo.Configuration

Configuration of postgres

func Connect added in v0.8.25

func Connect(cfg *Config) (db *sql.DB, err error)

Connect to postgres server

func Disconnect added in v0.8.25

func Disconnect(db *sql.DB) (err error)

Disconnect from postgres server

func DockerRecipeV3 added in v0.8.25

func DockerRecipeV3(s *Settings) *typdocker.Recipe

DockerRecipeV3 of postgres

func GetConfigName added in v0.8.28

func GetConfigName(s *Settings) string

GetConfigName from setting

func GetDBName added in v0.8.28

func GetDBName(s *Settings) string

GetDBName from setting

func GetDockerImage added in v0.8.28

func GetDockerImage(s *Settings) string

GetDockerImage from setting

func GetDockerName added in v0.8.28

func GetDockerName(s *Settings) string

GetDockerName from setting

func GetHost added in v0.8.28

func GetHost(s *Settings) string

GetHost from setting

func GetMigrationSrc added in v0.8.28

func GetMigrationSrc(s *Settings) string

GetMigrationSrc from setting if available or the default value

func GetPassword added in v0.8.28

func GetPassword(s *Settings) string

GetPassword from setting

func GetPort added in v0.8.28

func GetPort(s *Settings) int

GetPort from setting

func GetSeedSrc added in v0.8.28

func GetSeedSrc(s *Settings) string

GetSeedSrc from setting if available or the default value

func GetUser added in v0.8.28

func GetUser(s *Settings) string

GetUser from setting

func Utility added in v0.8.25

func Utility(s *Settings) typgo.Utility

Utility of postgres

Types

type Config

type Config struct {
	DBName   string `required:"true"`
	User     string `required:"true" default:"postgres"`
	Password string `required:"true" default:"pgpass"`
	Host     string `default:"localhost"`
	Port     int    `default:"5432"`
}

Config is postgres configuration

func (*Config) Admin added in v0.8.28

func (c *Config) Admin() *Config

Admin configuration

func (*Config) ConnStr added in v0.8.28

func (c *Config) ConnStr() string

ConnStr return connection string

type Settings added in v0.8.29

type Settings struct {
	Ctor string

	DockerName  string
	DockerImage string

	ConfigName string

	DBName   string
	User     string
	Password string
	Host     string
	Port     int

	MigrationSrc string
	SeedSrc      string
}

Settings for postgres

Jump to

Keyboard shortcuts

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