meta: wrap url type

This represents the URL cleanly during serialisation.

Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
2026-04-20 21:56:45 +09:00
parent 338cb1e000
commit 1a807bb438

20
meta/meta.go Normal file
View File

@@ -0,0 +1,20 @@
// 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) }