dsn

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyDsn defines error returned when no dsn is provided
	ErrEmptyDsn = errors.New("empty string provided for dsn")
	// ErrInvalidDsn defines error returned when the dsn is invalid
	ErrInvalidDsn = errors.New("invalid dsn")
)

Functions

This section is empty.

Types

type DSN

type DSN struct {
	Type       string
	Username   string
	Password   string
	Protocol   string
	Address    string
	Host       string
	Port       string
	DataSource string
	Params     map[string]string
}

DSN describes how a DSN looks like

func Parse

func Parse(s string) (*DSN, error)

Parse turns a dsn string into a parsed DSN struct. From https://play.golang.org/p/H3rbC4npryN

func (DSN) String

func (d DSN) String() string

String converts a DSN struct into its string representation.

Jump to

Keyboard shortcuts

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