typpg

package
v0.8.30 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configuration

func Configuration(s *Settings) *typgo.Configuration

Configuration of postgres

func Connect

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

Connect to postgres server

func Disconnect

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

Disconnect from postgres server

func DockerRecipeV3

func DockerRecipeV3(s *Settings) *typdocker.Recipe

DockerRecipeV3 of postgres

func Utility

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

func (c *Config) Admin() *Config

Admin configuration

func (*Config) ConnStr

func (c *Config) ConnStr() string

ConnStr return connection string

type Settings

type Settings struct {
	Ctor       string
	UtilityCmd string

	DockerName  string
	DockerImage string

	ConfigName string

	DBName   string
	User     string
	Password string
	Host     string
	Port     int

	MigrationSrc string
	SeedSrc      string
}

Settings for postgres

func Init

func Init(s *Settings) *Settings

Init settings

Jump to

Keyboard shortcuts

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