https://github.com/motdotla/redisurlparser
Redis url parser is a go library for parsing redis://.. URLs into struct friendly options.
https://github.com/motdotla/redisurlparser
Last synced: 7 months ago
JSON representation
Redis url parser is a go library for parsing redis://.. URLs into struct friendly options.
- Host: GitHub
- URL: https://github.com/motdotla/redisurlparser
- Owner: motdotla
- Created: 2014-05-25T08:26:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-31T00:18:01.000Z (over 11 years ago)
- Last Synced: 2025-01-24T04:37:21.365Z (9 months ago)
- Language: Go
- Size: 133 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# redisurlparser
Redis url parser is a go library for parsing redis://.. URLs into struct friendly options.
[](https://travis-ci.org/scottmotte/redisurlparser)
## Usage
```go
package mainimport (
"fmt"
"github.com/scottmotte/redisurlparser"
)func main() {
url := "redis://redistogo:64cfea0093507536a374ba6ad40f8463@angelfish.redistogo.com:10049/"result, err := redisurlparser.Parse(url)
if err != nil {
fmt.Println(err)
}fmt.Println(result.Username)
fmt.Println(result.Password)
fmt.Println(result.Host)
fmt.Println(result.Port)fmt.Println(result)
}
```