Documentation
¶
Overview ¶
Package logwrite contains helper functions to create instances of types in the logentry package.
Index ¶
- func ABool(b bool, unitID uint64) logentry.KGObject
- func AFloat64(f float64, unitID uint64) logentry.KGObject
- func AInt64(i int64, unitID uint64) logentry.KGObject
- func AKID(kid uint64) logentry.KGObject
- func AKIDOffset(offset int32) logentry.KGObject
- func AString(s string, langID uint64) logentry.KGObject
- func ATimestamp(t time.Time, p logentry.TimestampPrecision, unitID uint64) logentry.KGObject
- type InsertFactBuilder
- func (i *InsertFactBuilder) Fact() logentry.InsertFact
- func (i *InsertFactBuilder) FactID(offset int32) *InsertFactBuilder
- func (i *InsertFactBuilder) OBool(b bool, unitID uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) OFloat64(f float64, unitID uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) OInt64(v int64, unitID uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) OKID(kid uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) OOffset(offset int32) *InsertFactBuilder
- func (i *InsertFactBuilder) OString(s string, langID uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) OTimestamp(v time.Time, p logentry.TimestampPrecision, unitID uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) PID(kid uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) POffset(offset int32) *InsertFactBuilder
- func (i *InsertFactBuilder) SID(kid uint64) *InsertFactBuilder
- func (i *InsertFactBuilder) SOffset(offset int32) *InsertFactBuilder
- func (i *InsertFactBuilder) SetAutoFactID(enabled bool) *InsertFactBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AFloat64 ¶
AFloat64 returns a new KGObject instance containing the supplied float and Units ID.
func AKIDOffset ¶
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 ¶
AString returns a new KGObject instance containing the supplied string and language ID.
func ATimestamp ¶
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 ¶
func (i *InsertFactBuilder) Fact() logentry.InsertFact
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 ¶
func (i *InsertFactBuilder) OKID(kid uint64) *InsertFactBuilder
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 ¶
func (i *InsertFactBuilder) OTimestamp(v time.Time, p logentry.TimestampPrecision, unitID uint64) *InsertFactBuilder
OTimestamp sets a specific Timestamp and UnitID for the Object.
func (*InsertFactBuilder) PID ¶
func (i *InsertFactBuilder) PID(kid uint64) *InsertFactBuilder
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 ¶
func (i *InsertFactBuilder) SID(kid uint64) *InsertFactBuilder
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.