api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package api holds Hallmark's JSON:API DTOs and the mappers between them and the domain aggregates.

Index

Constants

View Source
const ResourceTypeAuditEvent resource.Type = "audit-events"

ResourceTypeAuditEvent is the JSON:API type for /api/audit-events.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEventDTO

type AuditEventDTO struct {
	resource.RestDTO

	RTimestamp    time.Time      `jsonapi:"attr,timestamp,omitempty"`
	RRealmID      string         `jsonapi:"attr,realmId,omitempty"`
	RActorID      string         `jsonapi:"attr,actorId,omitempty"`
	RActorType    string         `jsonapi:"attr,actorType,omitempty"`
	RResourceType string         `jsonapi:"attr,resourceType,omitempty"`
	RResourceID   string         `jsonapi:"attr,resourceId,omitempty"`
	RAction       string         `jsonapi:"attr,action,omitempty"`
	RSummary      string         `jsonapi:"attr,summary,omitempty"`
	RChanges      map[string]any `jsonapi:"attr,changes,omitempty"`
	RMetadata     map[string]any `jsonapi:"attr,metadata,omitempty"`
	RIP           string         `jsonapi:"attr,ip,omitempty"`
	RRequestID    string         `jsonapi:"attr,requestId,omitempty"`
}

AuditEventDTO is the read-only wire shape for an audit event. The REST surface never decodes it for writes — events are appended over gRPC.

func AuditEventToDTO

func AuditEventToDTO(e domain.AuditEvent) *AuditEventDTO

Jump to

Keyboard shortcuts

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