internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = log.New(os.Stderr, "DEBUG: ", log.Ltime|log.Lshortfile)
	Info  = log.New(os.Stderr, "INFO:  ", log.Ltime|log.Lshortfile)
	Error = log.New(os.Stderr, "ERROR: ", log.Ltime|log.Lshortfile)
)

Functions

This section is empty.

Types

type Service

type Service struct {
	Opts                ServiceOpts
	Context             context.Context
	KubernetesClientset *kubernetes.Clientset
	Ingresses           []ServiceIngress
	Prometheus          map[string]*ServicePrometheus
	// contains filtered or unexported fields
}

func NewService

func NewService(opts ServiceOpts) (*Service, error)

func (*Service) FindThreatMatches

func (s *Service) FindThreatMatches() (map[string]bool, error)

func (*Service) PrometheusForDomain

func (s *Service) PrometheusForDomain(domain string) *ServicePrometheus

func (*Service) Run

func (s *Service) Run(stop <-chan os.Signal) error

func (*Service) UpdateIngresses

func (s *Service) UpdateIngresses() error

func (*Service) UpdateThreatMatchMetrics

func (s *Service) UpdateThreatMatchMetrics() error

type ServiceIngress

type ServiceIngress struct {
	Namespace string
	Name      string
	Domains   []string
}

type ServiceOpts

type ServiceOpts struct {
	KubernetesRestConfig     *rest.Config
	GoogleSafebrowsingApiKey string
	Interval                 time.Duration
	AdditionalDomains        []string
}

type ServicePrometheus

type ServicePrometheus struct {
	ThreatMatches prometheus.Gauge
}

Jump to

Keyboard shortcuts

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