models

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 5 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageID added in v0.3.0

func MessageID() string

func MessageTimestamp added in v0.3.0

func MessageTimestamp() int64

Types

type Action

type Action struct {
	Type           string            `json:"type" yaml:"type"`
	Command        string            `json:"command" yaml:"command"`
	HideOutput     bool              `json:"hide_output" yaml:"hide_output"`
	OutputToVar    bool              `json:"output_to_var" yaml:"output_to_var"`
	OutputFailOnly bool              `json:"output_fail_only" yaml:"output_fail_only"`
	RunOnFail      bool              `json:"run_on_fail" yaml:"run_on_fail"`
	LastConfig     bool              `json:"last_config" yaml:"last_config"`
	Config         map[string]string `json:"config" yaml:"config"`
}

Action Struct

type Config

type Config struct {
	Version      string
	Logger       hclog.Logger
	Admins       string            `json:"admins" yaml:"admins"`
	ACL          string            `json:"acl" yaml:"acl"`
	PluginsDir   string            `json:"plugins_dir" yaml:"plugins_dir"`
	RulesDir     string            `json:"rules_dir" yaml:"rules_dir"`
	LogFile      string            `json:"log_file" yaml:"log_file"`
	Debug        bool              `json:"debug" yaml:"debug"`
	Trace        bool              `json:"trace" yaml:"trace"`
	Quiet        bool              `json:"quiet" yaml:"quiet"`
	BotName      string            `json:"bot_name" yaml:"bot_name"`
	CLI          bool              `json:"cli" yaml:"cli"`
	Auditing     bool              `json:"auditing" yaml:"auditing"`
	AuditingFile string            `json:"auditing_file" yaml:"auditing_file"`
	Slack        bool              `json:"slack" yaml:"slack"`
	SlackToken   string            `json:"slack_token" yaml:"slack_token"`
	SlackIcon    string            `json:"slack_icon" yaml:"slack_icon"`
	SlackDebug   bool              `json:"slack_debug" yaml:"slack_debug"`
	Scheduler    bool              `json:"scheduler" yaml:"scheduler"`
	Webhook      bool              `json:"webhook" yaml:"webhook"`
	WebhookPort  int               `json:"webhook_port" yaml:"webhook_port"`
	Command      string            `json:"command" yaml:"command"`
	Vars         map[string]string `json:"vars" yaml:"vars"`
}

Config struct

type Message

type Message struct {
	Debug      bool
	StartTime  int64
	EndTime    int64
	Attributes map[string]string
	Outputs    []Output
}

Message struct

func NewMessage added in v0.3.0

func NewMessage() (message Message)

MakeMessage function

type Output

type Output struct {
	Rule     string
	Success  bool
	Response string
	Command  string
}

type Plugin added in v0.3.0

type Plugin struct {
	Name   string
	Path   string
	Client *plugin.Client
	Action hexplugin.Action
}

Rule Struct

type Rule added in v0.3.0

type Rule struct {
	Id             string
	Name           string   `json:"rule" yaml:"rule"`
	Match          string   `json:"match" yaml:"match"`
	Schedule       string   `json:"schedule" yaml:"schedule"`
	URL            string   `json:"url" yaml:"url"`
	ACL            string   `json:"acl" yaml:"acl"`
	Channel        string   `json:"channel" yaml:"channel"`
	Format         bool     `json:"format" yaml:"format"`
	Threaded       bool     `json:"threaded" yaml:"threaded"`
	OutputFailOnly bool     `json:"output_fail_only" yaml:"output_fail_only"`
	OutputOnChange bool     `json:"output_on_change" yaml:"output_on_change"`
	GroupOutput    bool     `json:"group_output" yaml:"group_output"`
	Help           string   `json:"help" yaml:"help"`
	Hide           bool     `json:"hide" yaml:"hide"`
	Active         bool     `json:"active" yaml:"active"`
	Debug          bool     `json:"debug" yaml:"debug"`
	Actions        []Action `json:"actions" yaml:"actions"`
}

Rule Struct

type State

type State struct {
	LastRun     int64
	LastChange  int64
	LastAlert   int64
	RunStart    int64
	RunCount    int64
	LastRunTime int64
	AvgRunTime  int64
	Success     bool
	Running     bool
	Alert       bool
}

State Struct

Jump to

Keyboard shortcuts

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