Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Historical ¶
type Historical interface {
// Historical currently uses the [Item's Type]_history as the
// name of the store for the records
GetType() string
// Historical items must report themselves as historical for events
// using this func, which returns true of false
// Conditional historicity can be implemented in this
// method. For example, we may only want to store history on
// Items with a certain value, such as owned by a certain user
IsRecordableEvent(string) bool
}
Historical Types need an Type (GetType) name and a mechanism for deternining
whether to create a record (RecordHistory).
type HistoricalRecord ¶
A record of an _event_ that happened on a _Historical Object_
{
ID
Type string // the type of the object this history record covers
Event string // what happened at this point in history
Date time.Date // when did this happen
Record interface{} // the state of the document
}
func (HistoricalRecord) Record ¶
func (h HistoricalRecord) Record(e string, i Historical) error
Record takes an event string and Historical Item and writes
the record in history Records are written to the ItemType_history store
Click to show internal directories.
Click to hide internal directories.