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"
|
|
|
|
)
|
|
|
|
|
2024-03-08 18:37:26 +07:00
|
|
|
func NewUserPath[T any](id T) Path {
|
|
|
|
return NewPathFromString(NewUserPathString(id))
|
2023-12-16 09:35:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2023-12-16 09:35:33 +01:00
|
|
|
return f3.NewReference(NewUserPathString(id))
|
2023-12-15 08:09:10 +01:00
|
|
|
}
|