log_info

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2014 License: Apache-2.0 Imports: 11 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 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 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