archive

package
v0.0.76 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IsArchivedKey = "is_archived"
)

Variables

This section is empty.

Functions

func Idx added in v0.0.30

func Idx() []contract.IndexEntry

func IdxSrch added in v0.0.30

func IdxSrch() []contract.SearchIndexEntry

func Rules added in v0.0.24

Types

type Archive

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

Archive provides a mechanism to flag documents as archived. This flag enables filtering without preventing access to archived documents. It serves as an alternative to deletion, helping maintain data integrity and supporting queries for deprecated or legacy documents.

func Mock added in v0.0.42

func Mock() *Archive

func New added in v0.0.15

func New(m Meta, cr Core) *Archive

type Core

type Core struct {
	IsArchived *bool `json:"is_archived" validate:"nnpt"`
}

func ApplyCore

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

func (*Core) GetIsArchived

func (c *Core) GetIsArchived() bool

func (*Core) SetIsArchived

func (c *Core) SetIsArchived(x bool)

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithIsArchived

func WithIsArchived(x bool) CoreOption

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