Documentation
¶
Index ¶
- func CSVCell(s string) string
- func WithRequestID(ctx context.Context, id string) context.Context
- type ListQuery
- type Recorder
- func (r *Recorder) ExportCSV(ctx context.Context, q ListQuery, w io.Writer) error
- func (r *Recorder) List(ctx context.Context, workspaceID string, limit int) ([]map[string]any, error)
- func (r *Recorder) Query(ctx context.Context, q ListQuery) ([]map[string]any, int, error)
- func (r *Recorder) Record(ctx context.Context, workspaceID *string, p *webx.Principal, ...)
- func (r *Recorder) RecordTx(ctx context.Context, tx execer, workspaceID *string, p *webx.Principal, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func (*Recorder) RecordTx ¶ added in v0.4.0
func (r *Recorder) RecordTx(ctx context.Context, tx execer, workspaceID *string, p *webx.Principal, action, resourceType, resourceID string, meta map[string]any) error
RecordTx writes the audit entry inside the caller's transaction: failures return an error (the caller decides whether to roll back) - no swallowing, no detaching from the caller's ctx (opposite of Record's fire-and-forget). Product gates that need "business write and audit live or die together" should use this instead of hand-writing INSERT SQL (which silently decouples from schema evolution).
Click to show internal directories.
Click to hide internal directories.