dburl

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URL

type URL struct {
	URL              *url.URL
	MaxIdle, MaxOpen int
	MaxLife          time.Duration
}

func Parse

func Parse(str string) URL
Example
u := Parse(
	"postgres://develop:@localhost/goods_orders_dev?sslmode=disable",
)
fmt.Println(u.URL)
fmt.Println(u.MaxOpen, u.MaxIdle, u.MaxLife)
Output:

postgres://develop:@localhost/goods_orders_dev?sslmode=disable
10 0 10m0s
Example (WithParams)
u := Parse(
	"postgres://develop:@localhost/goods_orders_dev" +
		"?sslmode=disable&maxIdle=1&maxOpen=20&maxLife=1h",
)
fmt.Println(u.URL)
fmt.Println(u.MaxOpen, u.MaxIdle, u.MaxLife)
Output:

postgres://develop:@localhost/goods_orders_dev?sslmode=disable
20 1 1h0m0s

Jump to

Keyboard shortcuts

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