dsn

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: BSD-3-Clause Imports: 2 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 {
	Username string
	Password string
	Protocol string
	Address  string
	DBName   string
	Opts     *url.Values
}

DSN is a struct that represents a typical DSN

type DSN

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

func NewDSN

func NewDSN(c *Config) *DSN

func (*DSN) Address

func (dsn *DSN) Address(a string)

func (*DSN) DBName

func (dsn *DSN) DBName(db string)

func (*DSN) Opts

func (dsn *DSN) Opts(key, value string)

func (*DSN) Password

func (dsn *DSN) Password(p string)

func (*DSN) Protocol

func (dsn *DSN) Protocol(p string)

func (*DSN) String

func (dsn *DSN) String() string

String creates a string of the DSN, the output is formatteed `[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]`

func (*DSN) Username

func (dsn *DSN) Username(u string)

Jump to

Keyboard shortcuts

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