defaultv

package
v0.0.152 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsDefaultKey = "is_default"
)

Variables

This section is empty.

Functions

func Idx

func Idx() []contract.IndexEntry

func IdxSrch

func IdxSrch() []contract.SearchIndexEntry

func Rules

Types

type Core

type Core struct {
	IsDefault *bool `json:"is_default" validate:"nnpt"`
}

func ApplyCore

func ApplyCore(c *Core, modifiers ...CoreOption) Core

func (*Core) GetIsDefault

func (c *Core) GetIsDefault() bool

func (*Core) SetIsDefault

func (c *Core) SetIsDefault(x bool)

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithIsDefault

func WithIsDefault(x bool) CoreOption

type DefaultV

type DefaultV struct {
	Meta `bson:",inline" validate:"recurse"`
	Core `bson:",inline" validate:"recurse"`
}

DefaultV provides a mechanism to flag documents as default.

func Mock

func Mock(v bool) *DefaultV

func New

func New(m Meta, cr Core) *DefaultV

type Meta

type Meta struct{}

func ApplyMeta

func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta

type MetaOption

type MetaOption = contract.MetaOption[Meta]

Jump to

Keyboard shortcuts

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