EventPackage

Undocumented in source.
@safe
struct EventPackage {}

Members

Mixins

__anonymous
mixin HiBONRecord!(q{ import tagion.basic.ConsensusExceptions : ConsensusCheck = Check, ConsensusFailCode, EventConsensusException; protected alias consensus_check=ConsensusCheck!EventConsensusException; import std.stdio; /++ Used when a Event is receved from another node +/ this(const SecureNet net, const(Document) doc_epack) immutable { immutable _this=EventPackage(doc_epack); //this(doc_epack); this.signature=_this.signature; this.pubkey=_this.pubkey; this.event_body=_this.event_body; fingerprint=cast(Buffer)net.calcHash(_this.event_body); consensus_check(pubkey.length !is 0, ConsensusFailCode.EVENT_MISSING_PUBKEY); consensus_check(signature.length !is 0, ConsensusFailCode.EVENT_MISSING_SIGNATURE); consensus_check(net.verify(Fingerprint(fingerprint), signature, pubkey), ConsensusFailCode.EVENT_BAD_SIGNATURE); } /++ Create a EventPackage from a body +/ this(const SecureNet net, immutable(EventBody) ebody) immutable { pubkey=net.pubkey; event_body=ebody; auto sig = net.sign(event_body); signature = sig.signature; fingerprint = cast(Buffer) sig.message; } this(const SecureNet net, const Pubkey pkey, const Signature signature, immutable(EventBody) ebody) { pubkey=pkey; event_body=ebody; auto _fingerprint=net.calcHash(event_body); fingerprint = cast(Buffer) _fingerprint; this.signature=signature; consensus_check(net.verify(_fingerprint, signature, pubkey), ConsensusFailCode.EVENT_BAD_SIGNATURE); } })
Undocumented in source.

Variables

event_body
EventBody event_body;
Undocumented in source.
fingerprint
Buffer fingerprint;
Undocumented in source.
pubkey
Pubkey pubkey;
Undocumented in source.
signature
Signature signature;
Undocumented in source.

Mixed In Members

From mixin HiBONRecord!(q{ import tagion.basic.ConsensusExceptions : ConsensusCheck = Check, ConsensusFailCode, EventConsensusException; protected alias consensus_check=ConsensusCheck!EventConsensusException; import std.stdio; /++ Used when a Event is receved from another node +/ this(const SecureNet net, const(Document) doc_epack) immutable { immutable _this=EventPackage(doc_epack); //this(doc_epack); this.signature=_this.signature; this.pubkey=_this.pubkey; this.event_body=_this.event_body; fingerprint=cast(Buffer)net.calcHash(_this.event_body); consensus_check(pubkey.length !is 0, ConsensusFailCode.EVENT_MISSING_PUBKEY); consensus_check(signature.length !is 0, ConsensusFailCode.EVENT_MISSING_SIGNATURE); consensus_check(net.verify(Fingerprint(fingerprint), signature, pubkey), ConsensusFailCode.EVENT_BAD_SIGNATURE); } /++ Create a EventPackage from a body +/ this(const SecureNet net, immutable(EventBody) ebody) immutable { pubkey=net.pubkey; event_body=ebody; auto sig = net.sign(event_body); signature = sig.signature; fingerprint = cast(Buffer) sig.message; } this(const SecureNet net, const Pubkey pkey, const Signature signature, immutable(EventBody) ebody) { pubkey=pkey; event_body=ebody; auto _fingerprint=net.calcHash(event_body); fingerprint = cast(Buffer) _fingerprint; this.signature=signature; consensus_check(net.verify(_fingerprint, signature, pubkey), ConsensusFailCode.EVENT_BAD_SIGNATURE); } })

check
alias check = Check!(HiBONRecordException)
Undocumented in source.
__anonymous
mixin JSONString
Undocumented in source.
__anonymous
mixin HiBONRecordType
Undocumented in source.
isRecord
alias isRecord = HiBONRecord.isRecord!ThisType
Undocumented in source.
HAS_TYPE
enum HAS_TYPE;
Undocumented in source.
less_than
bool less_than(Key a, Key b)
Undocumented in source. Be warned that the author may not have intended to support it.
toHiBON
inout(HiBON) toHiBON()
Undocumented in source. Be warned that the author may not have intended to support it.
NO_DEFAULT_CTOR
enum NO_DEFAULT_CTOR;
Undocumented in source.
GetKeyName
template GetKeyName(uint i)
Undocumented in source.
_keys
string[] _keys()
keys
enum keys;
Undocumented in source.
this
this(HiBON hibon)
Undocumented in source.
this
this(Document doc)
Undocumented in source.
serialize
immutable(ubyte[]) serialize()
Undocumented in source. Be warned that the author may not have intended to support it.
toDoc
const(Document) toDoc()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta