Skip to content

chore: rearrange audit logging code into enterprise folder #3741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 31, 2022
Prev Previous commit
comment why Differ is necessary
  • Loading branch information
coadler committed Aug 31, 2022
commit c3115ecb843296b5cc07ecdc3dc59c69b8ff89ae
4 changes: 4 additions & 0 deletions coderd/audit/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ func Empty[T Auditable]() T {
// values.
func Diff[T Auditable](a Auditor, left, right T) Map { return a.diff(left, right) }

// Differ is used so the enterprise version can implement the diff function in
// the Auditor feature interface. Only types in the same package as the
// interface can implement unexported methods.
type Differ struct {
DiffFn func(old, new any) Map
}

//nolint:unused
func (d Differ) diff(old, new any) Map {
return d.DiffFn(old, new)
}