datasource

package
v0.40.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemePostgreSQL  = "postgres"
	SSLModeAllow      = "allow"
	SSLModeDisable    = "disable"
	SSLModePrefer     = "prefer"
	SSLModeRequire    = "require"
	SSLModeVerifyCA   = "verify-ca"
	SSLModeVerifyFull = "verify-full"
)

Variables

This section is empty.

Functions

func SSLModeParse

func SSLModeParse(s string) (string, error)

func SSLModeParseOrDefault

func SSLModeParseOrDefault(s, d string) string

Types

type DataSource

type DataSource struct {
	Scheme   string
	Host     string
	Port     uint
	Addr     string `json:"Addr,omitempty"`
	User     string `json:"User,omitempty"`
	Password string `json:"Password,omitempty"`
	Database string `json:"Database,omitempty"`
	SSLMode  string `json:"sslmode,omitempty"`
}

func (*DataSource) DSN

func (ds *DataSource) DSN() (string, error)

func (*DataSource) HostOrDefault

func (ds *DataSource) HostOrDefault() string

func (*DataSource) Hostname

func (ds *DataSource) Hostname() string

func (*DataSource) PortOrDefault

func (ds *DataSource) PortOrDefault() int

func (*DataSource) Trim

func (ds *DataSource) Trim()

func (*DataSource) UserPassword

func (ds *DataSource) UserPassword() string

Jump to

Keyboard shortcuts

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