archive

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 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"`
	// IsArchived indicates whether the document is archived.
	// example:false
	// required:false
	IsArchived *bool `bson:"is_archived" json:"is_archived" validate:"nonnilpointer"`
}

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. swagger:model

func NewArchive

func NewArchive(m Meta, c Comp, isArchived bool) (*Archive, error)

NewArchive creates a new Archive instance.

func (*Archive) GetIsArchived

func (a *Archive) GetIsArchived() bool

GetIsArchived returns whether the document is archived.

func (*Archive) SetIsArchived

func (a *Archive) SetIsArchived(x bool)

SetIsArchived sets the archived status of the document.

type Comp

type Comp struct{}

func ApplyComp

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

type CompOption

type CompOption = contract.CompOption[Comp]

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