postgres

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host            string
	Port            int32
	Database        string
	MaxOpenConns    uint32
	MaxConnLifetime time.Duration
	MaxConnIdleTime time.Duration
	User            User
	Admin           User

	//Additional options to be appended as options=<Options>
	//The value will be taken as is. Multiple options are space separated.
	Options string
}

func (*Config) Connect

func (c *Config) Connect(useAdmin bool) (*sql.DB, error)

func (*Config) DatabaseName

func (c *Config) DatabaseName() string

func (*Config) Decode

func (c *Config) Decode(configs []interface{}) (dialect.Connector, error)

func (*Config) MatchName

func (c *Config) MatchName(name string) bool

func (*Config) Password

func (c *Config) Password() string

func (Config) String

func (c Config) String(useAdmin bool) string

func (*Config) Type

func (c *Config) Type() string

func (*Config) Username

func (c *Config) Username() string

type SSL

type SSL struct {
	// type of connection security
	Mode string
	// RootCert Path to the CA certificate
	RootCert string
	// Cert Path to the client certificate
	Cert string
	// Key Path to the client private key
	Key string
}

type User

type User struct {
	Username string
	Password string
	SSL      SSL
}

Jump to

Keyboard shortcuts

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