This represents the URL cleanly during serialisation. Signed-off-by: Yonah <contrib@gensokyo.uk>
21 lines
580 B
Go
21 lines
580 B
Go
// Package meta defines system and member metadata types.
|
|
package meta
|
|
|
|
import (
|
|
"encoding"
|
|
"net/url"
|
|
)
|
|
|
|
// URL implements [encoding] interfaces on top of [url.URL].
|
|
type URL struct{ url.URL }
|
|
|
|
var (
|
|
_ encoding.TextAppender = new(URL)
|
|
_ encoding.TextMarshaler = new(URL)
|
|
_ encoding.TextUnmarshaler = new(URL)
|
|
)
|
|
|
|
func (u *URL) MarshalText() (data []byte, err error) { return u.MarshalBinary() }
|
|
func (u *URL) AppendText(data []byte) ([]byte, error) { return u.AppendBinary(data) }
|
|
func (u *URL) UnmarshalText(data []byte) error { return u.UnmarshalBinary(data) }
|