url

package
v0.0.0-...-202847b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package url parses program specific URLs and provides helper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConnection

func ParseConnection(raw string) (address, username, password string, params url.Values, err error)

ParseConnection parses a given URL using a custom URI scheme. For example:

redis://localhost:6379/?db=3
memcache://localhost:1313/?lazy=1
redis://:6380/?db=0 => connects to localhost:6380
redis:// => connects to localhost:6379 with DB 0
memcache:// => connects to localhost:11211
memcache://?server=localhost:11212&server=localhost:11213
	=> connects to: localhost:11211, localhost:11212, localhost:11213
redis://empty:myPassword@clusterName.xxxxxx.0001.usw2.cache.amazonaws.com:6379/?db=0

Available parameters: db, max_active (int, Connections), max_idle (int, Connections), idle_timeout (time.Duration, Connection), cancellable (0,1 request towards redis), lazy (0, 1 disables ping during connection setup). On successful parse the key "scheme" is also set in the params return value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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