Rename the main module to gotea.dev and the binary to gotea, and update the application name and English locale. Keep the external gitea.dev/sdk and gitea.dev/actionslib module imports unchanged. Assisted-by: OpenCode:DeepSeek-V4.1-Flash
26 lines
505 B
Go
26 lines
505 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package audit
|
|
|
|
import (
|
|
"io"
|
|
|
|
audit_model "gotea.dev/models/audit"
|
|
"gotea.dev/modules/json"
|
|
)
|
|
|
|
// WriteEventsAsJSON writes one JSON object per line.
|
|
func WriteEventsAsJSON(w io.Writer, events []*audit_model.Event) error {
|
|
for _, event := range events {
|
|
b, err := json.Marshal(event)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if _, err := w.Write(append(b, '\n')); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|