events

package
v0.0.0-...-86b787e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeID

func TypeID(em EventManager) int64

Types

type EventManager

type EventManager struct {
	ID              int64  `storm:"id,increment,index"`
	State           string `json:"state"` // new, ongoing, trusted
	Type            string `storm:"index" json:"type"`
	AttackerNetwork string `storm:"index"`
	AttackerIP      string `storm:"index"`
	EventType       interface{}
	Created         time.Time `storm:"index"`
	// contains filtered or unexported fields
}

func NewEventManager

func NewEventManager(typ, network, ip string, et EventType) *EventManager

func NewSensorEventManager

func NewSensorEventManager(network, ip string, e *EventSensor) *EventManager

func NewTokenEventManager

func NewTokenEventManager(network, ip string, e *EventToken) *EventManager

func (*EventManager) AddMutex

func (em *EventManager) AddMutex()

func (*EventManager) SendEvent

func (em *EventManager) SendEvent(state, host, key string) error

func (EventManager) SetSensorID

func (em EventManager) SetSensorID(i int64)

func (*EventManager) SetState

func (em *EventManager) SetState(db *storm.DB)

type EventSensor

type EventSensor struct {
	SensorID     int64  `json:"sensor_id"`
	Type         string `json:"type"`
	Port         int    `json:"port"`
	AttackerPort string `storm:"index" json:"attacker_port"`
}

func MapToEventSensor

func MapToEventSensor(em EventManager) EventSensor

func (*EventSensor) Is

func (e *EventSensor) Is() string

type EventToken

type EventToken struct {
	TokenID int64  `json:"token_id"`
	Type    string `json:"type"`
}

func (*EventToken) Is

func (e *EventToken) Is() string

func (*EventToken) MyID

func (e *EventToken) MyID() int64

type EventType

type EventType interface {
	Is() string
}

Jump to

Keyboard shortcuts

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