common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNumber8  = "number8"
	TypeNumber16 = "number16"
	TypeNumber32 = "number32"
	TypeNumber64 = "number64"
	TypeFloat64  = "float64"
	TypeString   = "string"
	// TypeBytes     = "bytes"
	TypeAddressV4 = "ipv4"
	TypeAddressV6 = "ipv6"
	TypeMac       = "mac"

	TypeTimestamp = "timestamp"
)

Variables

View Source
var SqlFields = map[string]string{
	TypeNumber8:   "UInt8",
	TypeNumber16:  "UInt16",
	TypeNumber32:  "UInt32",
	TypeNumber64:  "UInt64",
	TypeFloat64:   "Float64",
	TypeMac:       "UInt64",
	TypeAddressV4: "UInt32",
	TypeAddressV6: "FixedString(16)",

	TypeString:    "String",
	TypeTimestamp: "UInt64",
}

Functions

This section is empty.

Types

type ConvertableField

type ConvertableField interface {
	Convert(value string) (interface{}, error)
	GetName() string
}

type Field

type Field struct {
	Name string
	Type string
}

type FieldConverter

type FieldConverter func(value string) (interface{}, error)

type FlowMessage

type FlowMessage struct {
	Rule   string
	Fields FlowMessagePayload
}

type FlowMessagePayload

type FlowMessagePayload map[string]string

type Int16ModelField

type Int16ModelField struct {
	ModelField
}

func (*Int16ModelField) Convert

func (s *Int16ModelField) Convert(value string) (interface{}, error)

type IpToIntModelField

type IpToIntModelField struct {
	ModelField
}

func (*IpToIntModelField) Convert

func (s *IpToIntModelField) Convert(value string) (interface{}, error)

type ListModelField

type ListModelField struct {
	Values  map[string]int
	Default *int
	ModelField
}

func (*ListModelField) Convert

func (f *ListModelField) Convert(value string) (interface{}, error)

type Model

type Model struct {
	Table     string
	Statement string
	Fields    []ConvertableField
}

type ModelField

type ModelField struct {
	Name string
	Type string
}

func (*ModelField) GetName

func (f *ModelField) GetName() string

type PoolBump

type PoolBump struct {
	Reason string
	Rule   string
}

type PoolItem

type PoolItem struct {
	Size  int
	Last  time.Time
	Items []FlowMessagePayload
}

type Rule

type Rule struct {
	Name   string
	Table  string
	Regexp regexp.Regexp
	Fields []map[string]interface{}
}

type Rules

type Rules []Rule

type StringModelField

type StringModelField struct {
	ModelField
}

func (*StringModelField) Convert

func (s *StringModelField) Convert(value string) (interface{}, error)

type TimestampModelField

type TimestampModelField struct {
	Layout string
	ModelField
}

func (*TimestampModelField) Convert

func (f *TimestampModelField) Convert(value string) (interface{}, error)

type UInt16ModelField

type UInt16ModelField struct {
	ModelField
}

func (*UInt16ModelField) Convert

func (s *UInt16ModelField) Convert(value string) (interface{}, error)

Jump to

Keyboard shortcuts

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