Documentation ¶
Index ¶
- Variables
- type Uri
- func (u *Uri) Hash() string
- func (u *Uri) Host() string
- func (u *Uri) HostName() string
- func (u *Uri) IsValid() bool
- func (u Uri) MarshalJSON() ([]byte, error)
- func (u *Uri) Origin() string
- func (u *Uri) Path() string
- func (u *Uri) QueryString() string
- func (u *Uri) RootUri() Uri
- 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 NewFromFasthttpUri ¶ added in v0.18.0
NewFromFasthttpUri returns a new URI from the given URI. This function panics if the given *fasthttp.URI is nil.
func ParseBytes ¶
ParseBytes parses an URI and normalize it.
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) HostName ¶ added in v0.18.0
HostName returns hostname of URI: www.example.com 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) RootUri ¶ added in v0.18.0
RootUri returns a new Uri with path stripped to / and query args and fragment removed.
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.