model

package
v0.0.0-...-cc9a7d3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvBoolToBytes

func ConvBoolToBytes(value bool) []byte

ConvBoolToBytes convert the boolean value to a byte array

Types

type Event

type Event interface {

	// Tenant The optional tenant associated with the event
	Tenant() string

	// Type The optional type associated with the event
	Type() string

	// Timestamp The optional timestamp, will use current time if not defined
	Timestamp() time.Time

	// Fields The list of fields to be indexed for the event
	Fields() []*Field
}

Event The event to be stored

type Field

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

Field The field, defining a name/value associated with an event

func NewField

func NewField(name string, fieldType FieldType, value []byte) *Field

NewField returns a new field with name, field type and value

func (*Field) Name

func (field *Field) Name() string

Name the field name

func (*Field) Type

func (field *Field) Type() FieldType

Type the field type

func (*Field) Value

func (field *Field) Value() []byte

Value the field value

type FieldType

type FieldType struct {

	// Name The name of the field type
	Name string

	// VariableLength Whether the field is variable length
	VariableLength bool

	// FixedLength If fixed length field, otherwise -1
	FixedLength int
}

FieldType Information about the type of a field

var (
	// StringType represents a string
	StringType FieldType = FieldType{
		Name:           "string",
		VariableLength: true,
		FixedLength:    -1,
	}
	// BooleanType represents a boolean
	BooleanType FieldType = FieldType{
		Name:           "bool",
		VariableLength: false,
		FixedLength:    1,
	}
	// Int64Type represents a int64
	Int64Type FieldType = FieldType{
		Name:           "int64",
		VariableLength: false,
		FixedLength:    8,
	}
	// Float64Type represents a float64
	Float64Type FieldType = FieldType{
		Name:           "float64",
		VariableLength: false,
		FixedLength:    8,
	}
	// BinaryType represents a byte[]
	BinaryType FieldType = FieldType{
		Name:           "binary",
		VariableLength: true,
		FixedLength:    -1,
	}
)

Jump to

Keyboard shortcuts

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