Utilities
NewLocation
Encodes path model value into a Location
using a registered path adapter.
func NewLocation(ctx context.Context, model any) (Location, error)
Example:
loc, err := doors.NewLocation(ctx, ProductPath{
Item: true,
Id: 123,
Sort: "price",
})
if err != nil {
return err
}
path := loc.String() // "/products/123?sort=price"
Supported on static pages (PageRouter.StaticPage
)
RandId
Generates a secure random string identifier.
func RandId() string
- URL-safe, case-sensitive.
- Use for tokens, sessions, or instance IDs.
AllowBlocking
Enables blocking (Door.X...
) operations.
func AllowBlocking(ctx context.Context) context.Context