Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

sas1024/gorm-loggable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loggable

Loggable is used to helps tracking changes and history of your GORM models.

It creates change_logs table in your database and writes to all loggable models when they are changed.

Usage

  1. Register plugin using loggable.Register(db)
  2. Add loggable.LoggableModel to your GORM model
  3. If you want to set user, who makes changes, use loggable.SetUser("username").