behavior

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

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

type HistoricalRecord struct {
	ID    interface{}
	Event string
	Date  time.Time
	Item  interface{}
}

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

type Item

type Item interface {
	GetId() interface{}
	GetType() string
}

Jump to

Keyboard shortcuts

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