pub struct CloudEvent {
pub specversion: String,
pub id: String,
pub source: String,
pub event_type: String,
pub time: DateTime<Utc>,
pub datacontenttype: String,
pub data: Value,
}Expand description
Minimal CloudEvents 1.0 envelope.
Serialised as application/cloudevents+json (one envelope per line in JSONL
mode). Only the mandatory attributes plus datacontenttype are included;
extension attributes are not needed for Phase 1.
Fields§
§specversion: StringAlways "1.0".
id: StringUUIDv4 — unique per event occurrence.
source: Stringtsafe/<profile> — identifies the vault that produced this event.
event_type: StringReverse-DNS type identifier, e.g. com.tsafe.vault.secret.set.v1.
time: DateTime<Utc>ISO-8601 UTC timestamp of the event.
datacontenttype: StringAlways "application/json".
data: ValueEvent-specific payload. Never contains plaintext secret values.
Implementations§
Source§impl CloudEvent
impl CloudEvent
Sourcepub fn new(source: &str, event_type: impl Into<String>, data: Value) -> Self
pub fn new(source: &str, event_type: impl Into<String>, data: Value) -> Self
Construct a new envelope with a fresh id and time = now.
Sourcepub fn from_audit(entry: &AuditEntry) -> Self
pub fn from_audit(entry: &AuditEntry) -> Self
Project an AuditEntry into a CloudEvent.
The key field from the audit entry is replaced with an opaque
key_ref (see key_ref). The original audit timestamp is
preserved as the event time so replay is accurate.
Trait Implementations§
Source§impl Clone for CloudEvent
impl Clone for CloudEvent
Source§fn clone(&self) -> CloudEvent
fn clone(&self) -> CloudEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more