Documentation ¶
Index ¶
- type Journal
- func (journal Journal) Created() int64
- func (journal Journal) ETag() string
- func (journal Journal) IsDeleted() bool
- func (journal Journal) IsNew() bool
- func (journal *Journal) SetCreated(note string)
- func (journal *Journal) SetDeleted(note string)
- func (journal *Journal) SetUpdated(note string)
- func (journal Journal) Updated() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Journal ¶
type Journal struct { CreateDate int64 `path:"createDate" json:"createDate" bson:"createDate"` // CreateDate is the Unix epoch (milliseconds) that the attached object was created UpdateDate int64 `path:"updateDate" json:"updateDate" bson:"updateDate"` // UpdateDate is the Unix epoch (milliseconds) that the attached object was last updated DeleteDate int64 `path:"deleteDate" json:"deleteDate" bson:"deleteDate"` // DeleteDate is the Unix epoch (milliseconds) that the attached object was deleted Note string `path:"note" json:"note" bson:"note"` // Note is a human-readable description of the change that was made Revision int64 `path:"signature" json:"signature" bson:"signature"` // Signature is a unique identifier for this version of the object }
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) Created ¶ added in v0.15.1
Created returns the Unix epoch (in milliseconds) when the object containing this journal was created
func (Journal) ETag ¶
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 ¶
IsDeleted returns TRUE if the object has been "virtually deleted" from the database
func (*Journal) SetCreated ¶
SetCreated must be called whenever a new object is added to the database
func (*Journal) SetDeleted ¶
SetDeleted must be called to "virtual-delete" an object in the database
func (*Journal) SetUpdated ¶
SetUpdated must be called whenever an existing object is updated in the database