Version: v0.0.0-...-6719cd2 Latest Latest

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 5 Imported by: 0



Package logread deals with mapping from logentry types into rpc types. Services that have to read the log and process it will find this helpful.



View Source
const MaxOffset = 1000

MaxOffset contains the limit for the number of offsets available for a single log entry. offset must be 1 <= offset < MaxOffset


This section is empty.


func KID

func KID(index blog.Index, offset int32) uint64

KID calculates a KID given a log index and an offset. KIDs represent entities in the graph: subject, predicate, factIds. Index must be > 0 and offset must be 1 <= offset < MaxOffset. If you pass an index or offset that's outside the valid ranges for those this function will panic.

func KIDof

func KIDof(idx blog.Index, k *logentry.KIDOrOffset) uint64

KIDof will return the KID for this KIDOrOffset, resolving an offset to a KID given the provided log index if needed. It returns 0 if k does not have a specific KID or Offset set.

func ToRPCFact

func ToRPCFact(idx blog.Index, f *logentry.InsertFact) rpc.Fact

ToRPCFact converts a log representation of a InsertFact into the internal representation. This will resolve the final KIDs of any fields that were set with KID Offsets, and convert the KGObject from the logentry format to the rpc format.

func ToRPCKGObject

func ToRPCKGObject(idx blog.Index, from logentry.KGObject) rpc.KGObject

ToRPCKGObject returns a new rpc.KGObject instance that is equivalent to the supplied log representation of a KGObject. The rpc.KGObject encapsulates a binary encoding of the KGObject


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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