clickhouse

package
v0.0.0-...-2572d14 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchNftTablesDB

type FetchNftTablesDB struct {
	// nftables table id
	TableId uint64 `ch:"table_id"`
	// nftables table represented as string
	TableStr string `ch:"table_str"`
	// time stamps
	Timestamp time.Time `ch:"timestamp"`
}

FetchNftTablesDB - fetch nft tables fron DB

func (*FetchNftTablesDB) ToModel

type FetchTraceDB

type FetchTraceDB struct {
	// trace id
	TrId uint32 `ch:"trace_id"`
	// table id
	TableId uint64 `ch:"table_id"`
	// nftables table name
	Table string `ch:"table_name"`
	// nftables chain name
	Chain string `ch:"chain_name"`
	// nftables jump to a target name
	JumpTarget string `ch:"jump_target"`
	// nftables rule number
	RuleHandle uint64 `ch:"handle"`
	// rule expression
	Rule string `ch:"rule"`
	// verdict for the rule
	Verdict string `ch:"verdict"`
	// input network interface
	Iifname string `ch:"ifin"`
	// output network interface
	Oifname string `ch:"ifout"`
	// protocols family
	Family string `ch:"family"`
	// ip protocol (tcp/udp/icmp/...)
	IpProto string `ch:"ip_proto"`
	// length packet
	Length uint32 `ch:"len"`
	// source mac address
	SMacAddr string `ch:"mac_s"`
	// destination mac address
	DMacAddr string `ch:"mac_d"`
	// source ip address
	SAddr string `ch:"ip_s"`
	// destination ip address
	DAddr string `ch:"ip_d"`
	// source port
	SPort uint32 `ch:"sport"`
	// destination port
	DPort uint32 `ch:"dport"`
	// name of the security group for src ip
	SSgName string `ch:"sgname_s"`
	// name of the security group for dst ip
	DSgName string `ch:"sgname_d"`
	// name of the network for src ip
	SSgNet string `ch:"sgnet_s"`
	// name of the network for dst ip
	DSgNet string `ch:"sgnet_d"`
	// agent identifier
	UserAgent string `ch:"agent_id"`
	// time stamps
	Timestamp time.Time `ch:"timestamp"`
}

FetchTraceDB - fetch trace from DB

func (*FetchTraceDB) Columns

func (t *FetchTraceDB) Columns() (cols []string)

func (*FetchTraceDB) InitFromModel

func (t *FetchTraceDB) InitFromModel(msg *model.FetchTraceModel)

func (*FetchTraceDB) ToModel

func (t *FetchTraceDB) ToModel() model.FetchTraceModel

type NftTablesDB

type NftTablesDB struct {
	// nftables table name
	TableName string `ch:"table_name"`
	// ndtables table protocols family
	TableFamily string `ch:"table_family"`
	// nftables chain name
	ChainName string `ch:"chain_name"`
	// nftables rule expression
	Rule string `ch:"rule"`
	// nftables table represented as string
	TableStr string `ch:"table_str"`
	// time stamps
	Timestamp time.Time `ch:"timestamp"`
}

NftTablesDB - put nft tables data into DB

type NftTablesFilter

type NftTablesFilter struct {
	TableId []uint64 `ch:"table_id"`
}

func (*NftTablesFilter) Filters

func (t *NftTablesFilter) Filters() sq.Sqlizer

func (*NftTablesFilter) InitFromScope

func (t *NftTablesFilter) InitFromScope(scope filter.Scope)

type TraceDB

type TraceDB struct {
	// trace id
	TrId uint32 `ch:"trace_id"`
	// nftables table name
	Table string `ch:"table"`
	// nftables chain name
	Chain string `ch:"chain"`
	// nftables jump to a target name
	JumpTarget string `ch:"jump_target"`
	// nftables rule number
	RuleHandle uint64 `ch:"handle"`
	// protocols family
	Family string `ch:"family"`
	// input network interface
	Iifname string `ch:"ifin"`
	// output network interface
	Oifname string `ch:"ifout"`
	// source mac address
	SMacAddr string `ch:"mac_s"`
	// destination mac address
	DMacAddr string `ch:"mac_d"`
	// source ip address
	SAddr string `ch:"ip_s"`
	// destination ip address
	DAddr string `ch:"ip_d"`
	// source port
	SPort uint32 `ch:"sport"`
	// destination port
	DPort uint32 `ch:"dport"`
	// name of the security group for src ip
	SSgName string `ch:"sgname_s"`
	// name of the security group for dst ip
	DSgName string `ch:"sgname_d"`
	// name of the network for src ip
	SSgNet string `ch:"sgnet_s"`
	// name of the network for dst ip
	DSgNet string `ch:"sgnet_d"`
	// length packet
	Length uint32 `ch:"len"`
	// ip protocol (tcp/udp/icmp/...)
	IpProto string `ch:"ip_proto"`
	// verdict for the rule
	Verdict string `ch:"verdict"`
	// rule expression
	Rule string `ch:"rule"`
	// agent identifier
	UserAgent string `ch:"agent_id"`
	// time stamps
	Timestamp time.Time `ch:"timestamp"`
}

TraceDB - put trace into DB

func (*TraceDB) Columns

func (t *TraceDB) Columns() (cols []string)

func (*TraceDB) FieldTag

func (t *TraceDB) FieldTag(field interface{}) string

func (*TraceDB) InitFromTraceModel

func (t *TraceDB) InitFromTraceModel(msg *model.TraceModel)

func (*TraceDB) ToTraceModel

func (t *TraceDB) ToTraceModel() model.TraceModel

type TraceFilter

type TraceFilter struct {
	// traces ids
	TrId []uint32 `ch:"trace_id"`
	// nftables tables names
	Table []string `ch:"table_name"`
	// nftables chains names
	Chain []string `ch:"chain_name"`
	// nftables jump to a target names
	JumpTarget []string `ch:"jump_target"`
	// nftables rules numbers
	RuleHandle []uint64 `ch:"handle"`
	// protocols family
	Family []string `ch:"family"`
	// input network interfaces
	Iifname []string `ch:"ifin"`
	// output network interfaces
	Oifname []string `ch:"ifout"`
	// source mac addresses
	SMacAddr []string `ch:"mac_s"`
	// destination mac addresses
	DMacAddr []string `ch:"mac_d"`
	// source ip addresses
	SAddr []string `ch:"ip_s"`
	// destination ip addresses
	DAddr []string `ch:"ip_d"`
	// source ports
	SPort []uint32 `ch:"sport"`
	// destination ports
	DPort []uint32 `ch:"dport"`
	// names of the security group for src ip
	SSgName []string `ch:"sgname_s"`
	// names of the security group for dst ip
	DSgName []string `ch:"sgname_d"`
	// names of the network for src ip
	SSgNet []string `ch:"sgnet_s"`
	// names of the network for dst ip
	DSgNet []string `ch:"sgnet_d"`
	// lengths of packets
	Length []uint32 `ch:"len"`
	// ip protocols (tcp/udp/icmp/...)
	IpProto []string `ch:"ip_proto"`
	// verdicts of rules
	Verdict []string `ch:"verdict"`
	// rules expressions
	Rule []string `ch:"rule"`
	// time filter
	Time timeFilter `ch:"timestamp"`
	// complete sql Where clauses
	Query string
	// visor agents identifiers
	AgentsIds []string `ch:"agent_id"`
}

TraceFilter - filters for selecting trace from DB

func (*TraceFilter) Filters

func (t *TraceFilter) Filters() sq.Sqlizer

func (*TraceFilter) InitFromModel

func (t *TraceFilter) InitFromModel(msg *model.TraceScopeModel)

Jump to

Keyboard shortcuts

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