Files
gof3/tree/f3/user.go

24 lines
494 B
Go
Raw Normal View History

2023-12-15 08:09:10 +01:00
// Copyright Earl Warren <contact@earl-warren.org>
// Copyright Loïc Dachary <loic@dachary.org>
// SPDX-License-Identifier: MIT
package f3
import (
"fmt"
"lab.forgefriends.org/friendlyforgeformat/gof3/f3"
)
func NewUserPath[T any](id T) Path {
return NewPathFromString(NewUserPathString(id))
}
func NewUserPathString[T any](id T) string {
2023-12-15 08:09:10 +01:00
return fmt.Sprintf("/forge/users/%v", id)
}
func NewUserReference[T any](id T) *f3.Reference {
return f3.NewReference(NewUserPathString(id))
2023-12-15 08:09:10 +01:00
}