package structs

import "github.com/Kajmany/rapidrule/structs"

Index

Types

type Alert

type Alert struct {
	// Displayables
	Hotkey    rune
	ShortDesc string
	LongDesc  string
	Type      AlertType
}

func NewAlert

func NewAlert(alert_short string, alert_long string, alert_type AlertType) Alert

func (Alert) String

func (a Alert) String() string

type AlertType

type AlertType int
const (
	// Many systems ship with rules, worth a mention
	TablesAlready AlertType = iota
	// Need root to get proper resolution from ss or use nft
	NotRoot
	Red
	Yellow
)

type Eval

type Eval struct {
	Concerns    string `json:"concerns"`
	Investigate string `json:"investigate"`
	Confidence  string `json:"confidence"`
	Port        int    `json:"port"`
}

func (Eval) String

func (e Eval) String() string

type Judgement

type Judgement int

Should be made from structued LLM output

const (
	Good Judgement = iota
	Attention
	Bad
)

type JudgementProgress

type JudgementProgress int

Need to know where we're at with LLM requests

const (
	Unsent JudgementProgress = iota
	Inflight
	Done
)

type Port

type Port struct {
	// Displayables
	Hotkey    rune   // May need to change
	LocalAddr string // Can be text like loopback
	Port      int
	Process   string // Not PID, just name (add pid later if we need it)
	// Other state
	LLMRes    Judgement // Machine-readable judgement
	LLMStatus JudgementProgress
	Eval      *Eval
}

func (Port) String

func (p Port) String() string

func (Port) ToPrompt

func (p Port) ToPrompt() string

func (Port) ToRow

func (p Port) ToRow() table.Row

type StatusData

type StatusData struct {
	LocalAddr string
	LocalPort string
	PeerAddr  string
	PeerPort  string
	Process   string
}

type Strat

type Strat struct {
	Title string
	Body  string
	// contains filtered or unexported fields
}

strats/rules/etc

type TotalEval

type TotalEval struct {
	Overall    string `json:"overall"`
	Alert      string `json:"alert"`
	AlertShort string `json:"alert_short"`
	AlertLong  string `json:"alert_long"`
}

func (TotalEval) String

func (te TotalEval) String() string