journal

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Journal

type Journal struct {
	CreateDate int64  `json:"createDate" bson:"createDate"`
	UpdateDate int64  `json:"updateDate" bson:"updateDate"`
	DeleteDate int64  `json:"deleteDate" bson:"deleteDate"`
	Note       string `json:"note"       bson:"note"`
	Revision   int64  `json:"signature"  bson:"signature"`
}

Journal tracks a summary of changes to an object over time. Journal implements *most* of the data.Object interface (except for the ID function) right out of the box, so it's a useful example for implementing the data.Object interface, or even to embed directly into an existing model object.

func (*Journal) ETag

func (journal *Journal) ETag() string

ETag returns the signature for this object. It currently returns the "revision number" which should be fine unless we make out-of-band updates to objects.

func (*Journal) IsDeleted

func (journal *Journal) IsDeleted() bool

IsDeleted returns TRUE if the object has been "virtually deleted" from the database

func (*Journal) IsNew

func (journal *Journal) IsNew() bool

IsNew returns TRUE if the object has not yet been saved to the database

func (*Journal) SetCreated

func (journal *Journal) SetCreated(note string)

SetCreated must be called whenever a new object is added to the database

func (*Journal) SetDeleted

func (journal *Journal) SetDeleted(note string)

SetDeleted must be called to "virtual-delete" an object in the database

func (*Journal) SetUpdated

func (journal *Journal) SetUpdated(note string)

SetUpdated must be called whenever an existing object is updated in the database

Jump to

Keyboard shortcuts

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