log_info

package
v0.5.2-pre1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2014 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package log_info tracks changes to objects when they're saved, noting the actor performing the action, what kind of action it was, the time of the change, the type of object and its id, and a dump of the object's state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Import added in v0.5.2

func Import(logData map[string]interface{}) error

Import a log info event from an export dump.

func LogEvent

func LogEvent(doer actor.Actor, obj util.GoiardiObj, action string) error

Write an event of the action type, performed by the given actor, against the given object.

func PurgeLogInfos

func PurgeLogInfos(id int) (int64, error)

Types

type LogInfo

type LogInfo struct {
	Actor        actor.Actor `json:"-"`
	ActorInfo    string      `json:"actor_info"`
	ActorType    string      `json:"actor_type"`
	Time         time.Time   `json:"time"`
	Action       string      `json:"action"`
	ObjectType   string      `json:"object_type"`
	ObjectName   string      `json:"object_name"`
	ExtendedInfo string      `json:"extended_info"`
	Id           int         `json:"id"`
}

func AllLogInfos added in v0.5.2

func AllLogInfos() []*LogInfo

Return a list of all logged events in the database. Provides a wrapper around GetLogInfos() for consistency with the other object types for exporting data.

func Get

func Get(id int) (*LogInfo, error)

Get a particular event by its id.

func GetLogInfos

func GetLogInfos(limits ...int) []*LogInfo

Get a slice of the logged events. May be called with an offset and limit, (in that order) but that is not required. The offset can be specified without a limit, but a limit requires an offset (which can be 0).

func (*LogInfo) Delete

func (le *LogInfo) Delete() error

Jump to

Keyboard shortcuts

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