logwrite

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

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

Documentation

Overview

Package logwrite contains helper functions to create instances of types in the logentry package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ABool

func ABool(b bool, unitID uint64) logentry.KGObject

ABool returns an new KGObject instance containing a Boolean value and Units ID.

func AFloat64

func AFloat64(f float64, unitID uint64) logentry.KGObject

AFloat64 returns a new KGObject instance containing the supplied float and Units ID.

func AInt64

func AInt64(i int64, unitID uint64) logentry.KGObject

AInt64 returns a new KGObject instance containing the supplied int and Units ID.

func AKID

func AKID(kid uint64) logentry.KGObject

AKID returns an new KGObject instance containing a KID value.

func AKIDOffset

func AKIDOffset(offset int32) logentry.KGObject

AKIDOffset returns a new KGObject instance containing a KID offset. The offset describes a KID that is relative to the containing log entry

func AString

func AString(s string, langID uint64) logentry.KGObject

AString returns a new KGObject instance containing the supplied string and language ID.

func ATimestamp

func ATimestamp(t time.Time, p logentry.TimestampPrecision, unitID uint64) logentry.KGObject

ATimestamp returns a new KGObject instance containing a Timestamp for the supplied dateTime, precision and Units ID.

Types

type InsertFactBuilder

type InsertFactBuilder struct {
	// contains filtered or unexported fields
}

InsertFactBuilder is used to construct new logentry.InsertFact instances. It can be used to create many facts, however it is not safe for concurrent use. By default each call to Fact() will auto assign it an incrementing FactIDOffset, if you want to explicitly manage the offsets you can call SetAutoFactID(false) to disable that behavior.

func (*InsertFactBuilder) Fact

Fact returns a new InsertFact constructed from the prior calls to S*, P*, O* If AutoFactID is enabled (the default) an incrementing value for the FactIDOffset will be set if it hasn't been explicitly set. If AutoFactID is disabled, the FactID() method is used to specify the FactIDOffset that should be populated in the Fact.

Calls to Fact do not reset the state of any the fields. Subsequent calls to Fact will use the prior set value if not explicitly set since the last call to Fact.

func (*InsertFactBuilder) FactID

func (i *InsertFactBuilder) FactID(offset int32) *InsertFactBuilder

FactID sets a specific FactIDOffset

func (*InsertFactBuilder) OBool

func (i *InsertFactBuilder) OBool(b bool, unitID uint64) *InsertFactBuilder

OBool sets a specific Bool and UnitID for the Object.

func (*InsertFactBuilder) OFloat64

func (i *InsertFactBuilder) OFloat64(f float64, unitID uint64) *InsertFactBuilder

OFloat64 sets a specific Float64 and UnitID for the Object.

func (*InsertFactBuilder) OInt64

func (i *InsertFactBuilder) OInt64(v int64, unitID uint64) *InsertFactBuilder

OInt64 sets a specific Int64 and UnitID for the Object.

func (*InsertFactBuilder) OKID

OKID sets a specific KID for the Object.

func (*InsertFactBuilder) OOffset

func (i *InsertFactBuilder) OOffset(offset int32) *InsertFactBuilder

OOffset sets a specific KID Offset for the Object.

func (*InsertFactBuilder) OString

func (i *InsertFactBuilder) OString(s string, langID uint64) *InsertFactBuilder

OString sets a specific String and LangID for the Object.

func (*InsertFactBuilder) OTimestamp

OTimestamp sets a specific Timestamp and UnitID for the Object.

func (*InsertFactBuilder) PID

PID sets a specific KID for the Predicate.

func (*InsertFactBuilder) POffset

func (i *InsertFactBuilder) POffset(offset int32) *InsertFactBuilder

POffset sets a specific Offset for the Predicate.

func (*InsertFactBuilder) SID

SID sets a specific KID for the Subject.

func (*InsertFactBuilder) SOffset

func (i *InsertFactBuilder) SOffset(offset int32) *InsertFactBuilder

SOffset sets a specific Offset for the Subject.

func (*InsertFactBuilder) SetAutoFactID

func (i *InsertFactBuilder) SetAutoFactID(enabled bool) *InsertFactBuilder

SetAutoFactID will enable or disable the automatic setting of the FactIDOffset. If set each call to Fact() will automatically assign an increasing value to FactIDOffset if FactIDOffset was otherwise unset. This is enabled by default.

Jump to

Keyboard shortcuts

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