Help us shape the future of Go! Take the 2026 Go Developer Survey

content

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Catalog = ridu.Collection{
	Slug: "products",
	Fields: field.Fields{
		field.Text("name").Required(),
		Tags,
		field.NumberList("availableSizes").
			Min(0).Max(50).
			MaxRows(20),
	},
}
View Source
var Products = core.Collection{
	Slug: "products",
	Fields: field.Fields{
		field.Text("title").Required(),
		SellingPoints("sellingPoints").Label("Selling points"),
		Sizes("availableSizes").Default(8, 10, 12),
		SellingPoints("translatedPoints").Localized().DefaultFrom(
			func(ctx operation.Context) (operation.Value[[]string], error) {
				if ctx.Locale == "fr" {
					return operation.Present([]string{"Fabriqué à la main"}), nil
				}
				return operation.Present([]string{"Hand finished"}), nil
			}),
		Package("package"),
	},
}
View Source
var Tags = field.TextList("tags").
	MinLength(1).MaxLength(30).

	MaxRows(8) // Allow up to eight tags.
View Source
var UniqueTags = Tags.Validate(noRepeatedTags)

Functions

func CompactPackage

func CompactPackage(name string) (field.GroupField, error)

func FindTaggedProducts

func FindTaggedProducts(
	ctx context.Context,
	local *ridu.LocalAPI,
) (store.Page, error)

func Package

func Package(name string) field.GroupField

func SellingPoints

func SellingPoints(name string) field.TextListField

func Sizes

func Sizes(name string) field.NumberListField

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL