https://github.com/bndrmrtn/gourl
https://github.com/bndrmrtn/gourl
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bndrmrtn/gourl
- Owner: bndrmrtn
- Created: 2024-04-04T21:07:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T20:52:22.000Z (over 2 years ago)
- Last Synced: 2024-04-08T22:58:08.826Z (over 2 years ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GoURL
Simple Go package to manage URLs. Inspired by JavaScript's URL class.
## Usage
```go
url, _ := gourl.New("https://example.com/api/v1")
// error handling skipped now
fmt.Println(url.Hostname()) // example.com
url.Hostname("hello.com")
fmt.Println(url.Href()) // https://hello.com/api/v1
```
## Methods
Without a parameter every function is a getter. When a value is passed it will be a setter, but also returns the new value.
| Hash |
|:----------:|
| `Host` |
| `Hostname` |
| `Password` |
| `Pathname` |
| `Port` |
| `Protocol` |
| `Search` |
| `Username` |