postgres

package module
v0.0.0-...-60aba35 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

package postgres provides methods for connecting to a postgres database either raw or via ssh. Cribbed from vinzenz/dial-pq-via-ssh.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB(c *Config) (*sql.DB, error)

func ConnectDBViaSSH

func ConnectDBViaSSH(c *Config) (*sql.DB, error)

func InitConnection

func InitConnection(opts ...func(*Config)) (*sql.DB, error)

func WithDatabase

func WithDatabase(dbHost, dbUser, dbPass, dbName string) func(*Config)

func WithSSH

func WithSSH(sshHost, sshPort, sshUser, sshPass string) func(config *Config)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

type ViaSSHDialer

type ViaSSHDialer struct {
	// contains filtered or unexported fields
}

func (*ViaSSHDialer) Dial

func (self *ViaSSHDialer) Dial(network, address string) (net.Conn, error)

func (*ViaSSHDialer) DialTimeout

func (self *ViaSSHDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)

func (*ViaSSHDialer) Open

func (self *ViaSSHDialer) Open(s string) (_ driver.Conn, err error)

Jump to

Keyboard shortcuts

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