value_render

package
v1.10.12 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFloat64 error = errors.New("Only float64 type value could be calculated")
View Source
var ErrNotInt64 error = errors.New("Only int64 type value could be calculated")
View Source
var GOHANGOUT_TYPE_UNKNOWN_ERROR error = errors.New("field type unknown, it must be of json.Number|Int64|Int|int8")

Functions

This section is empty.

Types

type IndexRender

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

func NewIndexRender

func NewIndexRender(t string) *IndexRender

func (*IndexRender) Render

func (r *IndexRender) Render(event map[string]interface{}) interface{}

func (*IndexRender) SetTimeLocation

func (r *IndexRender) SetTimeLocation(loc string)

SetTimeLocation parse `location` to time.Location ans set it as its member. use this location to format time string

type JsonpathRender

type JsonpathRender struct {
	Pat *jsonpath.Compiled
}

func (*JsonpathRender) Render

func (r *JsonpathRender) Render(event map[string]interface{}) interface{}

type LiteralValueRender

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

func NewLiteralValueRender

func NewLiteralValueRender(template string) *LiteralValueRender

func (*LiteralValueRender) Render

func (r *LiteralValueRender) Render(event map[string]interface{}) interface{}

type MultiLevelValueRender

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

MultiLevelValueRender is a ValueRender that can render [xxx][yyy][zzz]

func NewMultiLevelValueRender

func NewMultiLevelValueRender(fields []string) *MultiLevelValueRender

NewMultiLevelValueRender create a MultiLevelValueRender

func (*MultiLevelValueRender) Render

func (vr *MultiLevelValueRender) Render(event map[string]interface{}) interface{}

Render implements ValueRender

type OneLevelValueRender

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

func NewOneLevelValueRender

func NewOneLevelValueRender(template string) *OneLevelValueRender

func (*OneLevelValueRender) Render

func (vr *OneLevelValueRender) Render(event map[string]interface{}) interface{}

type TemplateValueRender

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

func NewTemplateValueRender

func NewTemplateValueRender(t string) *TemplateValueRender

func (*TemplateValueRender) Render

func (r *TemplateValueRender) Render(event map[string]interface{}) interface{}

always return string

type ValueRender

type ValueRender interface {
	Render(map[string]interface{}) interface{}
}

func GetValueRender

func GetValueRender(template string) ValueRender

GetValueRender return a ValueRender, and return LiteralValueRender if no pattern matched

func GetValueRender2

func GetValueRender2(template string) ValueRender

GetValueRender2 return a ValueRender, and return OneLevelValueRender("message") if no pattern matched

Jump to

Keyboard shortcuts

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