archive

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsArchivedKey = "is_archived"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

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

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 New added in v0.0.15

func New(m Meta, c Comp, cr Core) *Archive

type Comp

type Comp struct{}

func ApplyComp

func ApplyComp(c *Comp, modifiers ...CompOption) Comp

type CompOption

type CompOption = contract.CompOption[Comp]

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