auditor

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 2 Imported by: 0

README

go-auditor

Library to record user event trails to any database or console.

MIT License GoDoc Build Status Go Report Card Contributions welcome

This is work in progress

The development on this library just started.

Features

  • [x]

Installation

$ go get -u github.com/openbooking/go-auditor

Quick Start

package main

}

Documentation

Overview

auditor Package provides a logging facility for user actions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditor

type Auditor interface {
	NewTrail(ctx context.Context, namespace, actor, clientIP string, group string) Trail
	FetchLog(group string, maxRows int) ([]LogEntry, error)
}

type Event

type Event struct {
	TargetID string
	Action   string
	Message  string
}

type LogEntry added in v1.1.0

type LogEntry struct {
	Event
	ID        int
	Namespace string
	Actor     string
	Timestamp time.Time
}

type Trail

type Trail interface {
	Log(event Event)
	LogIfChanged(event Event, oldval, newval interface{})
	LogIfBoolChanged(event Event, oldval, newval bool, trueMsg, falseMsg string)
	Success()
	Failed()
}

Directories

Path Synopsis
auditors

Jump to

Keyboard shortcuts

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