Documentation ¶
Index ¶
- func CreateEvent(ctx context.Context, dag format.DAGService, body format.Node, ...) (service.Event, error)
- func CreateRecord(ctx context.Context, dag format.DAGService, block format.Node, prev cid.Cid, ...) (service.Record, error)
- func DecodeBlock(block blocks.Block, key crypto.DecryptionKey) (format.Node, error)
- func EncodeBlock(block blocks.Block, key crypto.EncryptionKey) (format.Node, error)
- func GetEvent(ctx context.Context, dag format.DAGService, id cid.Cid) (service.Event, error)
- func GetRecord(ctx context.Context, dag format.DAGService, id cid.Cid, ...) (service.Record, error)
- func RecordFromNode(coded format.Node, key crypto.DecryptionKey) (service.Record, error)
- func RecordFromProto(rec *pb.Log_Record, key crypto.DecryptionKey) (service.Record, error)
- func RecordToProto(ctx context.Context, dag format.DAGService, rec service.Record) (*pb.Log_Record, error)
- type Event
- func (e *Event) BodyID() cid.Cid
- func (e *Event) GetBody(ctx context.Context, dag format.DAGService, key crypto.DecryptionKey) (format.Node, error)
- func (e *Event) GetHeader(ctx context.Context, dag format.DAGService, key crypto.DecryptionKey) (service.EventHeader, error)
- func (e *Event) HeaderID() cid.Cid
- type EventHeader
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEvent ¶ added in v0.1.6
func CreateEvent( ctx context.Context, dag format.DAGService, body format.Node, rkey crypto.EncryptionKey, ) (service.Event, error)
CreateEvent create a new event by wrapping the body node.
func CreateRecord ¶ added in v0.1.6
func CreateRecord( ctx context.Context, dag format.DAGService, block format.Node, prev cid.Cid, sk ic.PrivKey, key crypto.EncryptionKey, ) (service.Record, error)
CreateRecord returns a new record from the given block and log private key.
func DecodeBlock ¶
DecodeBlock returns a node by decrypting the block's raw bytes with key.
func EncodeBlock ¶
EncodeBlock returns a node by encrypting the block's raw bytes with key.
func GetRecord ¶
func GetRecord(ctx context.Context, dag format.DAGService, id cid.Cid, key crypto.DecryptionKey) (service.Record, error)
GetRecord returns a record from the given cid.
func RecordFromNode ¶
RecordFromNode decodes a record from a node using the given key.
func RecordFromProto ¶
func RecordFromProto(rec *pb.Log_Record, key crypto.DecryptionKey) (service.Record, error)
Unmarshal returns a node from a serialized version that contains link data.
func RecordToProto ¶
func RecordToProto(ctx context.Context, dag format.DAGService, rec service.Record) (*pb.Log_Record, error)
RecordToProto returns a proto version of a record for transport. Nodes are sent encrypted.
Types ¶
type Event ¶
Event is a IPLD node representing an event.
func EventFromNode ¶
EventFromNode decodes the given node into an event.
func EventFromRecord ¶
func EventFromRecord(ctx context.Context, dag format.DAGService, rec service.Record) (*Event, error)
EventFromRecord returns the event within the given node.
func (*Event) GetBody ¶
func (e *Event) GetBody(ctx context.Context, dag format.DAGService, key crypto.DecryptionKey) (format.Node, error)
GetBody returns the body node.
func (*Event) GetHeader ¶
func (e *Event) GetHeader( ctx context.Context, dag format.DAGService, key crypto.DecryptionKey, ) (service.EventHeader, error)
GetHeader returns the header node.
type EventHeader ¶
EventHeader is an IPLD node representing an event header.
func (*EventHeader) Key ¶
func (h *EventHeader) Key() (crypto.DecryptionKey, error)
Key returns the key needed to decrypt the event body if it has been decoded.