Documentation ¶
Index ¶
- Variables
- type Uri
- func (u *Uri) Hash() string
- func (u *Uri) Host() string
- func (u *Uri) IsValid() bool
- func (u Uri) MarshalJSON() ([]byte, error)
- func (u *Uri) Path() string
- func (u *Uri) QueryString() string
- func (u *Uri) Scan(src any) error
- func (u *Uri) Scheme() string
- func (u Uri) String() string
- func (u *Uri) UnmarshalJSON(b []byte) error
- func (u *Uri) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ErrUriIsRelative = errors.New("uri is relative")
Functions ¶
This section is empty.
Types ¶
type Uri ¶
type Uri struct {
// contains filtered or unexported fields
}
Uri define a read-only absolute URI object.
func Parse ¶
Parse parses an URI and normalize it. Raw query args are copied and stored if extractQuery is true.
func ParseBytes ¶
ParseBytes parses an URI and normalize it. Raw query args are copied and stored if extractQuery is true.
func (*Uri) Hash ¶
Hash returns hash of URI: bang for https://www.example.com:8080/foo/bar?q=baz#bang
func (*Uri) Host ¶
Host returns host of URI: www.example.com:8080 for https://www.example.com:8080/foo/bar?q=baz#bang
func (Uri) MarshalJSON ¶ added in v0.17.0
MarshalJSON implements json.Marshaler.
func (*Uri) Path ¶
Path returns normalized path of URI: /foo/bar for https://www.example.com:8080/foo/bar?q=baz#bang
func (*Uri) QueryString ¶
QueryBytes returns extracted query bytes (extractQuery must be true when calling Parse / ParseBytes): q=baz for https://www.example.com:8080/foo/bar?q=baz#bang
func (*Uri) Scheme ¶
Scheme returns scheme of URI: https for https://www.example.com:8080/foo/bar?q=baz#bang
func (*Uri) UnmarshalJSON ¶ added in v0.17.0
UnmarshalJSON implements json.Unmarshaler.