router

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ServiceNowTableDefault = "incident"
	AnonymizeReplacement   = "<hidden>"
)
View Source
const (
	B  = 1
	KB = 1024
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func BuildAndInitOtpt

func BuildAndInitOtpt(settings *ActionSettings, aquaServerUrl string) actions.Action

func SetupConnOptions added in v2.6.0

func SetupConnOptions(opts []nats.Option) []nats.Option

Types

type ActionSettings added in v2.4.0

type ActionSettings struct {
	Name                string                       `json:"name,omitempty"`
	Type                string                       `json:"type,omitempty"`
	RunsOn              string                       `json:"runs-on,omitempty"`
	Enable              bool                         `json:"enable,omitempty"`
	Url                 string                       `json:"url,omitempty"`
	User                string                       `json:"user,omitempty"`
	Password            string                       `json:"password,omitempty"`
	TlsVerify           bool                         `json:"tls-verify,omitempty"`
	ProjectKey          string                       `json:"project-key,omitempty" structs:"project-key,omitempty"`
	IssueType           string                       `json:"issuetype,omitempty" structs:"issuetype"`
	BoardName           string                       `json:"board,omitempty" structs:"board,omitempty"`
	Priority            string                       `json:"priority,omitempty"`
	Assignee            []string                     `json:"assignee,omitempty"`
	Summary             string                       `json:"summary,omitempty"`
	FixVersions         []string                     `json:"fix-versions,omitempty"`
	AffectsVersions     []string                     `json:"affects-versions,omitempty"`
	Labels              []string                     `json:"labels,omitempty"`
	Sprint              string                       `json:"sprint,omitempty"`
	Unknowns            map[string]string            `json:"unknowns,omitempty" structs:"unknowns,omitempty"`
	Host                string                       `json:"host,omitempty"`
	Port                int                          `json:"port,omitempty"`
	Recipients          []string                     `json:"recipients,omitempty"`
	Sender              string                       `json:"sender,omitempty"`
	Token               string                       `json:"token,omitempty"`
	UseMX               bool                         `json:"use-mx,omitempty"`
	InstanceName        string                       `json:"instance,omitempty"`
	SizeLimit           int                          `json:"size-limit,omitempty"`
	InputFile           string                       `json:"input-file,omitempty"`
	ExecScript          string                       `json:"exec-script,omitempty"`
	Env                 []string                     `json:"env,omitempty"`
	BodyFile            string                       `json:"body-file,omitempty"`
	BodyContent         string                       `json:"body-content,omitempty"`
	Method              string                       `json:"method,omitempty"`
	Timeout             string                       `json:"timeout,omitempty"`
	Headers             map[string][]string          `json:"headers,omitempty"`
	OrganizationId      string                       `json:"organization-id,omitempty"`
	KubeConfigFile      string                       `json:"kube-config-file,omitempty"`
	KubeLabelSelector   string                       `json:"kube-label-selector,omitempty"`
	KubeActions         map[string]map[string]string `json:"kube-actions,omitempty"`
	KubeNamespace       string                       `json:"kube-namespace,omitempty"`
	DockerImageName     string                       `json:"docker-image-name,omitempty"`
	DockerNetwork       string                       `json:"docker-network,omitempty"`
	DockerCmd           []string                     `json:"docker-cmd,omitempty"`
	DockerVolumes       map[string]string            `json:"docker-volume-mounts,omitempty"`
	DockerEnv           []string                     `json:"docker-env,omitempty"`
	Tags                []string                     `json:"tags,omitempty"`
	Alias               string                       `json:"alias,omitempty"`
	Entity              string                       `json:"entity,omitempty"`
	PagerdutyAuthToken  string                       `json:"pagerduty-auth-token,omitempty"`
	PagerdutyRoutingKey string                       `json:"pagerduty-routing-key,omitempty"`
}

type Router

type Router struct {
	ConfigCh      chan *nats.Msg
	Mode          string
	NatsServer    *server.Server
	NatsConn      *nats.Conn
	NatsMsgCh     chan *nats.Msg
	RunnerName    string
	ControllerURL string
	// contains filtered or unexported fields
}

func Instance

func Instance() *Router

func (*Router) GetCurrentEvents added in v2.7.0

func (ctx *Router) GetCurrentEvents() []any

func (*Router) HandleRoute

func (ctx *Router) HandleRoute(routeName string, in []byte)

func (*Router) ReloadConfig

func (ctx *Router) ReloadConfig()

func (*Router) Send

func (ctx *Router) Send(data []byte)

func (*Router) Start

func (ctx *Router) Start(cfgfile string) error

func (*Router) Terminate

func (ctx *Router) Terminate()

type Rule added in v2.8.0

type Rule struct {
	Name string `json:"name,omitempty"`
	ID   string `json:"id,omitempty"`
}

type Template

type Template struct {
	Name               string `json:"name,omitempty"`
	Body               string `json:"body,omitempty"`
	RegoPackage        string `json:"rego-package,omitempty"`
	LegacyScanRenderer string `json:"legacy-scan-renderer,omitempty"`
	Url                string `json:"url,omitempty"`
}

type TenantSettings

type TenantSettings struct {
	AquaServer      string              `json:"aqua-server,omitempty"`
	DBMaxSize       string              `json:"max-db-size,omitempty"`
	DBRemoveOldData int                 `json:"delete-old-data,omitempty"`
	DBTestInterval  int                 `json:"db-verify-interval,omitempty"`
	Actions         []ActionSettings    `json:"actions,omitempty"`
	InputRoutes     []routes.InputRoute `json:"routes,omitempty"`
	Templates       []Template          `json:"templates,omitempty"`
	Rules           []Rule              `json:"rules,omitempty"`
}

func Parsev2cfg

func Parsev2cfg(cfgpath string) (*TenantSettings, error)

Jump to

Keyboard shortcuts

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