server

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package server provides tarian server functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAlertmanagerClient

func NewAlertmanagerClient(amURL *url.URL) *client.Alertmanager

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type AlertDispatcher

type AlertDispatcher struct {
	// contains filtered or unexported fields
}

func NewAlertDispatcher

func NewAlertDispatcher(amURL *url.URL, alertEvaluationInterval time.Duration) *AlertDispatcher

func (*AlertDispatcher) LoopSendAlerts

func (a *AlertDispatcher) LoopSendAlerts(ctx context.Context, es store.EventStore)

func (*AlertDispatcher) SendAlert

func (a *AlertDispatcher) SendAlert(event *tarianpb.Event) error

type ConfigServer

type ConfigServer struct {
	tarianpb.UnimplementedConfigServer
	// contains filtered or unexported fields
}

func NewConfigServer

func NewConfigServer(constraintStore store.ConstraintStore, actionStore store.ActionStore) *ConfigServer

func (*ConfigServer) AddAction

func (*ConfigServer) AddConstraint

func (*ConfigServer) GetActions

func (*ConfigServer) GetConstraints

func (*ConfigServer) RemoveAction

func (*ConfigServer) RemoveConstraint

type EventServer

type EventServer struct {
	tarianpb.UnimplementedEventServer
	// contains filtered or unexported fields
}

func NewEventServer

func NewEventServer(s store.EventStore) *EventServer

func (*EventServer) GetEvents

func (*EventServer) IngestEvent

type Server

type Server struct {
	GrpcServer      *grpc.Server
	EventServer     *EventServer
	ConfigServer    *ConfigServer
	AlertDispatcher *AlertDispatcher
	// contains filtered or unexported fields
}

func NewServer

func NewServer(storeSet store.StoreSet, certFile string, privateKeyFile string) (*Server, error)

func (*Server) Start

func (s *Server) Start(grpcListenAddress string) error

func (*Server) StartAlertDispatcher

func (s *Server) StartAlertDispatcher()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) WithAlertDispatcher

func (s *Server) WithAlertDispatcher(alertManagerAddress *url.URL, alertEvaluationInterval time.Duration) *Server

Directories

Path Synopsis
Package dgraphstore provides store implementation with Dgraph
Package dgraphstore provides store implementation with Dgraph

Jump to

Keyboard shortcuts

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