Documentation ¶
Index ¶
- Constants
- func ConnectTimeout(t time.Duration) dialects.Option
- func Env(env *Environment) dialects.Option
- func Extension(f dialects.Extension) dialects.Option
- func FallbackApplicationName(name string) dialects.Option
- func PreferSimpleProtocol(simple *bool) dialects.Option
- func SSLCert(location string) dialects.Option
- func SSLKey(location string) dialects.Option
- func SSLMode(value SSLOption) dialects.Option
- func SSLRootCert(location string) dialects.Option
- type Builder
- func (b *Builder) Build(user, password, host string, port int, dbname string) gorm.Dialector
- func (b *Builder) BuildDialector(url string) gorm.Dialector
- func (b *Builder) BuildString(user, password, host string, port int, dbname string) string
- func (b *Builder) IsNotAvailableLock(err error) bool
- func (b *Builder) Name() string
- type Environment
- type SSLOption
Constants ¶
View Source
const ( DefaultPort = "5432" NotAvailableLock = "55P03" )
Variables ¶
This section is empty.
Functions ¶
func Env ¶
func Env(env *Environment) dialects.Option
func FallbackApplicationName ¶
func PreferSimpleProtocol ¶
func SSLRootCert ¶
Types ¶
type Builder ¶
type Builder struct { SslMode string FallbackApplicationName string ConnectTimeout time.Duration SslCert string SslKey string SslRootCert string PreferSimpleProtocol bool Extension dialects.Extension }
func (*Builder) BuildString ¶
func (*Builder) IsNotAvailableLock ¶
type Environment ¶
type Environment struct { SslMode string FallbackApplicationName string ConnectTimeout string SslCert string SslKey string SslRootCert string PreferSimpleProtocol string }
func (*Environment) Build ¶
func (env *Environment) Build(b *Builder)
type SSLOption ¶
type SSLOption string
const ( // disable - No SSL SslDisable SSLOption = "disable" // require - Always SSL (skip verification) SslRequire SSLOption = "require" // verify-ca - Always SSL (verify that the certificate presented by the // server was signed by a trusted CA) SslVerifyCa SSLOption = "verify-ca" // verify-full - Always SSL (verify that the certification presented by the // server was signed by a trusted CA and the server host name matches the one in the certificate) SslVerifyFull SSLOption = "verify-full" )
Click to show internal directories.
Click to hide internal directories.