collection

package
v1.46.27 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreFieldMismatch = datastore.IgnoreFieldMismatch

Functions

func Query

Types

type Collection

type Collection struct {
	mixin.Model[Collection]

	// Unique human readable identifier
	Slug string `json:"slug"`

	// Name of Collection
	Name string `json:"name"`

	// Description of collection
	Description string `datastore:",noindex" json:"description"`

	// Image/Video/Other Media to show in a gallery
	Media []Media `json:"media" orm:"default:[]"`

	// Is the collection available
	Available bool `json:"available"`

	// Range in which collection is available. If active, it takes precedent
	// over Available bool.
	Availability struct {
		Active    bool      `json:"active'"`
		StartDate time.Time `json:"startDate"`
		EndDate   time.Time `json:"endDate"`
	} `json:"availability"`

	// Show this on store?
	Published bool `json:"published"`

	// Is this a preorder?
	Preorder bool `json:"preorder"`

	// Is this in stock?
	OutOfStock bool `json:"outOfStock"`

	// Lists of products or specific product variants that are part of this collection
	ProductIds []string `json:"productIds" orm:"default:[]"`
	VariantIds []string `json:"variantIds" orm:"default:[]"`

	History []Event `json:"-" orm:"default:[]"`
}

A collection of Products/Variants to be listed on a store

func Fake

func Fake(db *datastore.Datastore, itemIdType string, itemIds ...string) *Collection

func New

func New(db *datastore.Datastore) *Collection

func (Collection) DisplayTitle

func (c Collection) DisplayTitle() string

func (Collection) GetDescriptionParagraphs

func (c Collection) GetDescriptionParagraphs() []string

func (*Collection) Validator

func (c *Collection) Validator() *val.Validator

Jump to

Keyboard shortcuts

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